summaryrefslogtreecommitdiff
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-10-23 13:35:13 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-10-24 08:56:21 +0200
commit03717be7885d84783bc8ea32a65e42e4970f59d6 (patch)
treecb67f5f3e44ffc49435480ff699f8528b2719efb /tests/auto/gui
parentaa4b0f5cb7e84046530fbc26581f777506fea658 (diff)
downloadqtbase-03717be7885d84783bc8ea32a65e42e4970f59d6.tar.gz
Fix: confusion in QImage paintEngine creation on shared images
During the creation of a raster paint engine in QImage::paintEngine(), the QImage will be detached. At least old gcc versions would get confused so that the newly created paintengine would end up in the old QImage copy insteads of the newly detached one. Work around by dropping the temporary engine pointer. Fixes: QTBUG-79383 Change-Id: I27b1f24312269bc2bcc641dc4334397a92e3bfbb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index b84aa52465..2a9b92ed35 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -2132,6 +2132,12 @@ void tst_QImage::paintEngine()
QCOMPARE(engine, img.paintEngine());
QCOMPARE(img, expected);
+
+ {
+ QImage img1(16, 16, QImage::Format_ARGB32);
+ QImage img2 = img1;
+ QVERIFY(img2.paintEngine());
+ }
}
void tst_QImage::setAlphaChannelWhilePainting()