From dacfd67ad35ed3edb079e9795088f852b98717e3 Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Mon, 13 Jul 2009 10:27:15 +0200 Subject: Stabilize tst_QGraphicsView::mouseTracking2 (on Windows). Use QApplication::sendEvent directly instead of calling the static sendMouseMove function, which also calls QTest::mouseMove. This test failed with spy.count() being 2 instead of 1 (which is correct since we both use QTest::mouseMove and QApplication::sendEvent). --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 77ab977..9a5089b 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3311,7 +3311,9 @@ void tst_QGraphicsView::mouseTracking2() EventSpy spy(&scene, QEvent::GraphicsSceneMouseMove); QCOMPARE(spy.count(), 0); - sendMouseMove(view.viewport(), view.viewport()->rect().center()); + QMouseEvent event(QEvent::MouseMove,view.viewport()->rect().center(), Qt::NoButton, + Qt::MouseButtons(Qt::NoButton), 0); + QApplication::sendEvent(view.viewport(), &event); QCOMPARE(spy.count(), 1); } -- cgit v0.12