From fd57e1449dc974417f3409a4da7338d7e8a6e7c8 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 17 Aug 2016 12:12:36 -0700 Subject: 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 Reviewed-by: Mitch Curtis --- src/qmltest/quicktestevent.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qmltest') 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(item); + if (window) + return window; + QQuickItem *quickItem = qobject_cast(item); if (quickItem) return quickItem->window(); -- cgit v1.2.3