summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-09-17 15:25:08 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-17 15:25:08 (GMT)
commit1d05c5221ba8ad3f5d3d36ba2025ea45bc3afe88 (patch)
tree6cba08738ce9fcdb0d1d8d7417b336a8521f36a1 /tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
parentb7923d48fb6d755d4563eeed0e7f3cbc774d69d5 (diff)
parent0db5ca5c733422b28524791b4f292227a61090d2 (diff)
downloadQt-1d05c5221ba8ad3f5d3d36ba2025ea45bc3afe88.zip
Qt-1d05c5221ba8ad3f5d3d36ba2025ea45bc3afe88.tar.gz
Qt-1d05c5221ba8ad3f5d3d36ba2025ea45bc3afe88.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: tests/auto/qtwidgets/tst_qtwidgets.cpp
Diffstat (limited to 'tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 304330e..2f2a268 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -2920,18 +2920,16 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
Q_CHECK_PAINTEVENTS
QGraphicsScene scene;
- EventTester *tester = new EventTester;
- scene.addItem(tester);
- tester->setAcceptsHoverEvents(true);
-
QGraphicsView view(&scene);
view.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
+ QTest::qWait(250);
- qApp->processEvents();
- qApp->processEvents();
+ EventTester *tester = new EventTester;
+ scene.addItem(tester);
+ tester->setAcceptsHoverEvents(true);
QTRY_COMPARE(tester->repaints, 1);
@@ -2945,7 +2943,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
int npaints = tester->repaints;
qApp->processEvents();
qApp->processEvents();
- QCOMPARE(tester->events.size(), 3); // activate + enter + move
+ QCOMPARE(tester->events.size(), 2); // enter + move
QCOMPARE(tester->repaints, npaints + 1);
QCOMPARE(tester->events.last(), QEvent::GraphicsSceneHoverMove);
@@ -2959,7 +2957,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
qApp->processEvents();
qApp->processEvents();
- QCOMPARE(tester->events.size(), 4);
+ QCOMPARE(tester->events.size(), 3);
QCOMPARE(tester->repaints, npaints + 1);
QCOMPARE(tester->events.last(), QEvent::GraphicsSceneHoverMove);
@@ -2973,7 +2971,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
qApp->processEvents();
qApp->processEvents();
- QCOMPARE(tester->events.size(), 5);
+ QCOMPARE(tester->events.size(), 4);
QCOMPARE(tester->repaints, npaints + 2);
QCOMPARE(tester->events.last(), QEvent::GraphicsSceneHoverLeave);
}
@@ -6510,6 +6508,9 @@ void tst_QGraphicsItem::cacheMode()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
+ // Increase the probability of window activation
+ // not causing another repaint of test items.
+ QTest::qWait(250);
EventTester *tester = new EventTester;
EventTester *testerChild = new EventTester;