summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-09-29 12:35:34 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-29 12:35:34 (GMT)
commit82ad1edea9fd6d6955ab9e3f661c625f7ba5ed78 (patch)
tree58934af99acbd49c4f9bedf66fc4a94d784048ec /tests/auto/qgraphicsitem
parent63be458a64d6f88333cd921e587b2c651acb122f (diff)
parent640ae542541b66a5da85ce76309f9595ed2c8bf3 (diff)
downloadQt-82ad1edea9fd6d6955ab9e3f661c625f7ba5ed78.zip
Qt-82ad1edea9fd6d6955ab9e3f661c625f7ba5ed78.tar.gz
Qt-82ad1edea9fd6d6955ab9e3f661c625f7ba5ed78.tar.bz2
Merge branch '4.5' into 4.6
Conflicts: doc/src/platform-notes.qdoc src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp src/gui/graphicsview/qgraphicsitem.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
Diffstat (limited to 'tests/auto/qgraphicsitem')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 956faa1..d08e74b 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -62,7 +62,6 @@
#include "../../shared/util.h"
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -307,6 +306,7 @@ private slots:
void task240400_clickOnTextItem();
void task243707_addChildBeforeParent();
void task197802_childrenVisibility();
+ void QTBUG_4233_updateCachedWithSceneRect();
private:
QList<QGraphicsItem *> paintedItems;
@@ -8463,5 +8463,34 @@ void tst_QGraphicsItem::stackBefore()
QCOMPARE(scene.items(QPointF(2, 2), Qt::IntersectsItemBoundingRect, Qt::AscendingOrder), (QList<QGraphicsItem *>() << child2 << child4 << child3 << child1));
}
+void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect()
+{
+ EventTester *tester = new EventTester;
+ tester->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+
+ QGraphicsScene scene;
+ scene.addItem(tester);
+ scene.setSceneRect(-100, -100, 200, 200); // contains the tester item
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+
+ QCOMPARE(tester->repaints, 1);
+
+ scene.update(); // triggers "updateAll" optimization
+ qApp->processEvents();
+ qApp->processEvents(); // in 4.6 only one processEvents is necessary
+
+ QCOMPARE(tester->repaints, 1);
+
+ scene.update(); // triggers "updateAll" optimization
+ tester->update();
+ qApp->processEvents();
+ qApp->processEvents(); // in 4.6 only one processEvents is necessary
+
+ QCOMPARE(tester->repaints, 2);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"