diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-10-06 11:15:35 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-10-06 11:15:35 (GMT) |
commit | 0d6c7a6b0dafec4e579916e99725d3f8b49d0910 (patch) | |
tree | 810f9c50e882ec67fff351bd112b0d5d48bf7495 /tests/auto/qpixmap/tst_qpixmap.cpp | |
parent | 9c73671c3b917a2a6a22411fb17c46dfa5e21049 (diff) | |
parent | 1f5afc4300d3d7e3063f4e2c80a280a5098717d1 (diff) | |
download | Qt-0d6c7a6b0dafec4e579916e99725d3f8b49d0910.zip Qt-0d6c7a6b0dafec4e579916e99725d3f8b49d0910.tar.gz Qt-0d6c7a6b0dafec4e579916e99725d3f8b49d0910.tar.bz2 |
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
Diffstat (limited to 'tests/auto/qpixmap/tst_qpixmap.cpp')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 19 |
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" |