diff options
author | Jeremy Katz <jeremy@panix.com> | 2016-08-17 12:12:36 -0700 |
---|---|---|
committer | Jeremy Katz <jeremy@panix.com> | 2016-08-22 22:53:39 +0000 |
commit | fd57e1449dc974417f3409a4da7338d7e8a6e7c8 (patch) | |
tree | 11d8086d266f974e7d2908e3e7556ae6c2eafe96 /src/qmltest | |
parent | 457bb7a465fc51995fc5ffaa4a1d8a341528d0c4 (diff) |
allow quick test events to directly target a Window
QuickTestEvent::eventWindow() is used to determine the window a
QObject-based item cast to a QQuickItem is associated with. The window
is then used to dispatch simulated events and calculate item positions.
This change allows a quick Window or other QWindow-based object to be
used directly.
Change-Id: I85866ca4c79d5b6a48bac554608cad348aeb6e98
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qmltest')
-rw-r--r-- | src/qmltest/quicktestevent.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp index f722fab6c4..966a60671d 100644 --- a/src/qmltest/quicktestevent.cpp +++ b/src/qmltest/quicktestevent.cpp @@ -317,6 +317,10 @@ bool QuickTestEvent::mouseMove QWindow *QuickTestEvent::eventWindow(QObject *item) { + QWindow * window = qobject_cast<QWindow *>(item); + if (window) + return window; + QQuickItem *quickItem = qobject_cast<QQuickItem *>(item); if (quickItem) return quickItem->window(); |