diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2013-02-12 12:58:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-12 15:21:57 +0100 |
commit | 62d25e4d4f02a53da25b9f14cc9e0244d6655312 (patch) | |
tree | b418fe83622504a33f9423136db30e20733cba92 /tests | |
parent | f5acd545a8bf8b187be6b3dd29f095b1fa7e94ea (diff) |
Fixed QPixmapCache associating path with wrong QPixmap.
QPixmap::load() would not detach, so multiple paths could get associated
with the same QPixmap, causing the wrong pixmap to be shown.
Task-number: QTBUG-29639
Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 0e86a425f3..f5298a1690 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -166,6 +166,7 @@ private slots: void loadAsBitmapOrPixmap(); void scaled_QTBUG19157(); + void detachOnLoad_QTBUG29639(); }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -1488,5 +1489,19 @@ void tst_QPixmap::scaled_QTBUG19157() QVERIFY(!foo.isNull()); } +void tst_QPixmap::detachOnLoad_QTBUG29639() +{ + const QString prefix = QFINDTESTDATA("convertFromImage"); + + QPixmap a; + a.load(prefix + "/task31722_0/img1.png"); + a.load(prefix + "/task31722_0/img2.png"); + + QPixmap b; + b.load(prefix + "/task31722_0/img1.png"); + + QVERIFY(a.toImage() != b.toImage()); +} + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" |