From 2431bf1b20e2815e0da3d294cce129de775b8f39 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 3 Aug 2014 02:46:00 +0200 Subject: QPixelFormat: don't inherit it Instead of abusing inheritance to provide convenience constructors, use simple inline constructor functions. The name got a lower-case q to indicate a free function. The usual fromXYZ() static methods were deemed not fitting in this case in the initial round of review, since they implied some kind of conversion while these functions are simply constructors of formsts, which contain no data. This also solves the problem that some of these ctors could have been called with just one argument and were therefore candidates for hidden QPixelFormat temporary injection. QPixelFormatRgb was renamed to qPixelFormatRgba to explain the third argument at the call site better. There seem to be no users of this class in qt5.git at this time. Change-Id: Ib4fe8ceb2d30744127b116a748724a3406400eb8 Reviewed-by: Thiago Macieira --- tests/auto/gui/image/qimage/tst_qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/gui/image') diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index f922deb815..cc555edcf5 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -2559,7 +2559,7 @@ void tst_QImage::scaled_QTBUG35972() void tst_QImage::convertToPixelFormat() { - QPixelFormat rgb565 = QPixelFormatRgb(5,6,5,0,QPixelFormat::IgnoresAlpha, QPixelFormat::AtBeginning, QPixelFormat::NotPremultiplied, QPixelFormat::UnsignedShort); + QPixelFormat rgb565 = qPixelFormatRgba(5,6,5,0,QPixelFormat::IgnoresAlpha, QPixelFormat::AtBeginning, QPixelFormat::NotPremultiplied, QPixelFormat::UnsignedShort); QPixelFormat rgb565ImageFormat = QImage::toPixelFormat(QImage::Format_RGB16); QCOMPARE(rgb565, rgb565ImageFormat); } -- cgit v1.2.3