diff options
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 2b337da..ba117d8 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -103,6 +103,7 @@ private slots: void grabWidget(); void grabWindow(); void isNull(); + void task_246446(); #ifdef Q_WS_QWS void convertFromImageNoDetach(); @@ -1015,5 +1016,20 @@ void tst_QPixmap::fromData() QCOMPARE(img.pixel(0, 1), QRgb(0xff000000)); } +void tst_QPixmap::task_246446() +{ + // This crashed without the bugfix in 246446 + QPixmap pm(10, 10); + pm.fill(Qt::transparent); // force 32-bit depth + QBitmap bm; + pm.setMask(bm); + { + QPixmap pm2(pm); + } + QVERIFY(pm.width() == 10); + QVERIFY(pm.mask().isNull()); +} + + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" |