summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-08 12:15:22 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:43:38 (GMT)
commitc07239ac97dfce35a6b277c82ec5445e01eb2249 (patch)
tree18cf87fdf7cf151d04b97a64b45a7d43d97ae102
parente8e1cdaea063dc3613b38315ca401ef55340fcbb (diff)
downloadQt-c07239ac97dfce35a6b277c82ec5445e01eb2249.zip
Qt-c07239ac97dfce35a6b277c82ec5445e01eb2249.tar.gz
Qt-c07239ac97dfce35a6b277c82ec5445e01eb2249.tar.bz2
Add another auto-test ensuring updates outside the brect are discared.
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 7a789c5..35a7bb9 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -6487,6 +6487,14 @@ void tst_QGraphicsItem::update()
const QRegion expectedRegion = itemDeviceBoundingRect.adjusted(-2, -2, 2, 2);
// The entire item's bounding rect (adjusted for antialiasing) should have been painted.
QCOMPARE(view.paintedRegion, expectedRegion);
+
+ // Make sure update requests outside the bounding rect are discarded.
+ view.reset();
+ item->repaints = 0;
+ item->update(-15, -15, 5, 5); // Item's brect: (-10, -10, 20, 20)
+ qApp->processEvents();
+ QCOMPARE(item->repaints, 0);
+ QCOMPARE(view.repaints, 0);
}
void tst_QGraphicsItem::setTransformProperties_data()