summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/image/qpixmap/tst_qpixmap.cpp')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 72609d4095..e3bda6c2df 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -119,6 +119,7 @@ private slots:
void refUnref();
void copy();
+ void deepCopyPreservesDpr();
void depthOfNullObjects();
void transformed();
@@ -1133,6 +1134,19 @@ void tst_QPixmap::copy()
QCOMPARE(trans, transCopy);
}
+// QTBUG-58653: Force a deep copy of a pixmap by
+// having a QPainter and check whether DevicePixelRatio is preserved
+void tst_QPixmap::deepCopyPreservesDpr()
+{
+ const qreal dpr = 2;
+ QPixmap src(32, 32);
+ src.setDevicePixelRatio(dpr);
+ src.fill(Qt::red);
+ QPainter painter(&src);
+ const QPixmap dest = src.copy();
+ QCOMPARE(dest.devicePixelRatio(), dpr);
+}
+
void tst_QPixmap::depthOfNullObjects()
{
QBitmap b1;