diff options
Diffstat (limited to 'tests/auto/shared')
-rw-r--r-- | tests/auto/shared/visualtestutil.cpp | 9 | ||||
-rw-r--r-- | tests/auto/shared/visualtestutil.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/shared/visualtestutil.cpp b/tests/auto/shared/visualtestutil.cpp index 60b8790d..5e44f5e7 100644 --- a/tests/auto/shared/visualtestutil.cpp +++ b/tests/auto/shared/visualtestutil.cpp @@ -38,6 +38,7 @@ #include <QtQuick/QQuickItem> #include <QtCore/QDebug> +#include <QtGui/QCursor> bool QQuickVisualTestUtil::delegateVisible(QQuickItem *item) { @@ -69,3 +70,11 @@ void QQuickVisualTestUtil::dumpTree(QQuickItem *parent, int depth) } } +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 +} diff --git a/tests/auto/shared/visualtestutil.h b/tests/auto/shared/visualtestutil.h index 12f955ea..bcf45660 100644 --- a/tests/auto/shared/visualtestutil.h +++ b/tests/auto/shared/visualtestutil.h @@ -54,6 +54,8 @@ namespace QQuickVisualTestUtil bool delegateVisible(QQuickItem *item); + void moveMouseAway(QQuickWindow *window); + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index |