summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2568b94..36c1518 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -166,6 +166,8 @@ private slots:
void fromImage_crash();
void fromData();
+
+ void preserveDepth();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1448,6 +1450,23 @@ void tst_QPixmap::task_246446()
QVERIFY(pm.mask().isNull());
}
+void tst_QPixmap::preserveDepth()
+{
+ QPixmap target(64, 64);
+ target.fill(Qt::transparent);
+
+ QPixmap source(64, 64);
+ source.fill(Qt::white);
+
+ int depth = source.depth();
+
+ QPainter painter(&target);
+ painter.setBrush(source);
+ painter.drawRect(target.rect());
+ painter.end();
+
+ QCOMPARE(depth, source.depth());
+}
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"