summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstyle/tst_qstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qstyle/tst_qstyle.cpp')
-rw-r--r--tests/auto/qstyle/tst_qstyle.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp
index ad5d7ff..5c319f0 100644
--- a/tests/auto/qstyle/tst_qstyle.cpp
+++ b/tests/auto/qstyle/tst_qstyle.cpp
@@ -272,6 +272,18 @@ void tst_QStyle::drawItemPixmap()
QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG");
QPixmap actualPix = QPixmap::grabWidget(testWidget);
+
+#ifdef Q_OS_SYMBIAN
+ // QPixmap cannot be assumed to be exactly same, unless it is created from exactly same content.
+ // In Symbian, pixmap format might get "optimized" depending on how QPixmap is created.
+ // Therefore, force the content to specific format and compare QImages.
+ // Then re-create the QPixmaps and compare those.
+ QImage i1 = p.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ p = QPixmap::fromImage(i1);
+ QImage i2 = actualPix.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ actualPix = QPixmap::fromImage(i2);
+ QVERIFY(i1 == i2);
+#endif
QVERIFY(pixmapsAreEqual(&actualPix,&p));
testWidget->hide();
}