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 1d77f70919..417514607f 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -120,6 +120,7 @@ private slots:
void copy();
void deepCopyPreservesDpr();
+ void fillPreservesDpr();
void dprPassthrough();
void depthOfNullObjects();
@@ -1156,6 +1157,19 @@ void tst_QPixmap::deepCopyPreservesDpr()
QCOMPARE(dest.devicePixelRatio(), dpr);
}
+// Check that the DPR is preserved after doing a fill after an
+// assigned copy of the QPixmap
+void tst_QPixmap::fillPreservesDpr()
+{
+ const qreal dpr = 2;
+ QPixmap src(32, 32);
+ src.setDevicePixelRatio(dpr);
+ src.fill(Qt::red);
+ QPixmap dest = src;
+ dest.fill(Qt::blue);
+ QCOMPARE(dest.devicePixelRatio(), dpr);
+}
+
void tst_QPixmap::dprPassthrough()
{
const qreal dpr = 2;