summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-17 10:46:18 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-17 10:46:18 (GMT)
commita31db11ac224e52d23faeaace3d4213e4fc5e19c (patch)
tree6ffad8b19ecfe316bae2010004e1d208a72f60b9 /tests
parent3db470f76b5e9cc576197164f666bd5d43bfbfbd (diff)
downloadQt-a31db11ac224e52d23faeaace3d4213e4fc5e19c.zip
Qt-a31db11ac224e52d23faeaace3d4213e4fc5e19c.tar.gz
Qt-a31db11ac224e52d23faeaace3d4213e4fc5e19c.tar.bz2
Stabilize tst_QGraphicsItem::hoverEventsGenerateRepaints.
Make the test independent of window activation; we're only interested in the behavior for hover events.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 2fc2b49..a7aaa76 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -2921,18 +2921,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);
@@ -2946,7 +2944,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);
@@ -2960,7 +2958,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);
@@ -2974,7 +2972,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);
}