diff options
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index abd9604..a94b9d7 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -5467,9 +5467,12 @@ public: QCOMPARE(pixmap.size(), rect.size()); \ QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \ expectedPixmap.fill(color); \ - if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 ) \ + QImage image = pixmap.toImage(); \ + uint alphaCorrection = image.format() == QImage::Format_RGB32 ? 0xff000000 : 0; \ + uint firstPixel = image.pixel(0,0) | alphaCorrection; \ + if ( firstPixel != QColor(color).rgb() && t < 4 ) \ { QTest::qWait(200); continue; } \ - QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb()); \ + QCOMPARE(firstPixel, QColor(color).rgb()); \ QCOMPARE(pixmap, expectedPixmap); \ break; \ } \ |