summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorAndreas Kling <andreas.kling@nokia.com>2010-09-25 17:23:12 (GMT)
committerAndreas Kling <andreas.kling@nokia.com>2010-09-26 14:29:27 (GMT)
commitbcb4dbebe2f6216842ce443bfc6d126943020a35 (patch)
treead236dfb3f01ef7e844b36358511f7afb0021659 /tests/auto/qpainter
parent23e03ee30dcd140a51073a0dd665bd871927d05e (diff)
downloadQt-bcb4dbebe2f6216842ce443bfc6d126943020a35.zip
Qt-bcb4dbebe2f6216842ce443bfc6d126943020a35.tar.gz
Qt-bcb4dbebe2f6216842ce443bfc6d126943020a35.tar.bz2
Fix QPainter::clipBoundingRect() for QRectF clip.
clipBoundingRect() wasn't handling QPainterClipInfo::RectFClip properly, mistaking it for PathClip. Reviewed-by: Samuel Rødal
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 9b8444c..ae97285 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -4543,6 +4543,14 @@ void tst_QPainter::clipBoundingRect()
QVERIFY(p.clipBoundingRect().contains(QRect(120, 120, 20, 20)));
QVERIFY(!p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+ // Test a basic float rectangle
+ p.setClipRect(QRectF(100, 100, 200, 100));
+ QVERIFY(p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(50, 50, 300, 200)));
+ p.setClipRect(QRectF(120, 120, 20, 20), Qt::IntersectClip);
+ QVERIFY(p.clipBoundingRect().contains(QRect(120, 120, 20, 20)));
+ QVERIFY(!p.clipBoundingRect().contains(QRectF(100, 100, 200, 100)));
+
// Test a basic path + region
QPainterPath path;
path.addRect(100, 100, 200, 100);