summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-07-16 21:55:23 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-07-16 21:55:23 (GMT)
commit1f5e32a11114370e4364fcfa77b9c4ab4bf192a3 (patch)
tree5761a1e1d6dfac01c50d1c91187c20378383fe6f /tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
parentf60dea8315fef502f6f4c6941455a51bee66efd9 (diff)
parent6470f646d0815f67bab507c1362cdda775c42a6e (diff)
downloadQt-1f5e32a11114370e4364fcfa77b9c4ab4bf192a3.zip
Qt-1f5e32a11114370e4364fcfa77b9c4ab4bf192a3.tar.gz
Qt-1f5e32a11114370e4364fcfa77b9c4ab4bf192a3.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui-gv
Conflicts: src/declarative/fx/qfxitem.h src/declarative/util/qfxview.h src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp')
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index e9d6f1d..f7ea4ce 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -236,6 +236,7 @@ private slots:
void contextMenuEvent();
void contextMenuEvent_ItemIgnoresTransformations();
void update();
+ void update2();
void views();
void event();
void eventsToDisabledItems();
@@ -2779,6 +2780,32 @@ void tst_QGraphicsScene::update()
QCOMPARE(region, QRectF(-100, -100, 200, 200));
}
+void tst_QGraphicsScene::update2()
+{
+ QGraphicsScene scene;
+ scene.setSceneRect(-200, -200, 200, 200);
+ CustomView view;
+ view.setScene(&scene);
+ view.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&view);
+#endif
+ QTest::qWait(250);
+ view.repaints = 0;
+
+ // Make sure QGraphicsScene::update only requires one event-loop iteration
+ // before the view is updated.
+ scene.update();
+ qApp->processEvents();
+ QCOMPARE(view.repaints, 1);
+ view.repaints = 0;
+
+ // The same for partial scene updates.
+ scene.update(QRectF(-100, -100, 100, 100));
+ qApp->processEvents();
+ QCOMPARE(view.repaints, 1);
+}
+
void tst_QGraphicsScene::views()
{
QGraphicsScene scene;