aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared/visualtestutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/shared/visualtestutil.cpp')
-rw-r--r--tests/auto/shared/visualtestutil.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/shared/visualtestutil.cpp b/tests/auto/shared/visualtestutil.cpp
index 5e44f5e7..47cfd74f 100644
--- a/tests/auto/shared/visualtestutil.cpp
+++ b/tests/auto/shared/visualtestutil.cpp
@@ -39,6 +39,7 @@
#include <QtQuick/QQuickItem>
#include <QtCore/QDebug>
#include <QtGui/QCursor>
+#include <QtCore/QCoreApplication>
bool QQuickVisualTestUtil::delegateVisible(QQuickItem *item)
{
@@ -74,7 +75,10 @@ void QQuickVisualTestUtil::moveMouseAway(QQuickWindow *window)
{
#if QT_CONFIG(cursor) // Get the cursor out of the way.
QCursor::setPos(window->geometry().topRight() + QPoint(100, 100));
-#else
- Q_UNUSED(window)
#endif
+
+ // make sure hover events from QQuickWindowPrivate::flushFrameSynchronousEvents()
+ // do not interfere with the tests
+ QEvent leave(QEvent::Leave);
+ QCoreApplication::sendEvent(window, &leave);
}