diff options
author | axis <qt-info@nokia.com> | 2009-06-08 06:51:51 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-06-08 06:51:51 (GMT) |
commit | d4257360234a967bfbacde92ec2bb1ac8979b793 (patch) | |
tree | a907ea5fe0d3142ecefce50b79c735554efdf39b /tests/auto/qpainter/tst_qpainter.cpp | |
parent | 5163d6e1a36f48bf9d8483d3ca23ec730b5188c0 (diff) | |
parent | 3b2b9d727f0fadf607968c73003e7550c8bd0296 (diff) | |
download | Qt-d4257360234a967bfbacde92ec2bb1ac8979b793.zip Qt-d4257360234a967bfbacde92ec2bb1ac8979b793.tar.gz Qt-d4257360234a967bfbacde92ec2bb1ac8979b793.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
tests/auto/qlocalsocket/tst_qlocalsocket.cpp
Diffstat (limited to 'tests/auto/qpainter/tst_qpainter.cpp')
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index b813d1d..740cfb1 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -219,6 +219,7 @@ private slots: void imageCoordinateLimit(); void imageBlending_data(); void imageBlending(); + void imageBlending_clipped(); void paintOnNullPixmap(); void checkCompositionMode(); @@ -3795,6 +3796,31 @@ void tst_QPainter::imageBlending() } } +void tst_QPainter::imageBlending_clipped() +{ + QImage src(20, 20, QImage::Format_RGB16); + QPainter p(&src); + p.fillRect(src.rect(), Qt::red); + p.end(); + + QImage dst(40, 20, QImage::Format_RGB16); + p.begin(&dst); + p.fillRect(dst.rect(), Qt::white); + p.end(); + + QImage expected = dst; + + p.begin(&dst); + p.setClipRect(QRect(23, 0, 20, 20)); + + // should be completely clipped + p.drawImage(QRectF(3, 0, 20, 20), src); + p.end(); + + // dst should be left unchanged + QCOMPARE(dst, expected); +} + void tst_QPainter::paintOnNullPixmap() { QPixmap pix(16, 16); |