diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-12-16 15:48:00 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-12-17 14:26:21 +0000 |
commit | 2debae1600a3f7f997115e277cb08747d4549f1a (patch) | |
tree | a5f7617e4761e5aca39a80019ad4811cf88c1913 /src/testlib/qtestsystem.h | |
parent | 6d5b07c509c109e2a0624e3fdfce926377e6ed60 (diff) |
Use closest QWindow when waiting for a widget to become active/exposed
A child widget without a native handle would previously not be treated as
exposed or active, even if the closest QWindow actually was, resulting
in qWaitFor returning false and QVERIFY failing.
Change-Id: I9df41cbac7aeab63bfa59d8ac77880591393c085
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/testlib/qtestsystem.h')
-rw-r--r-- | src/testlib/qtestsystem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index 4973412f9b..98daa0392e 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -116,14 +116,14 @@ namespace QTest #ifdef QT_WIDGETS_LIB inline static bool qWaitForWindowActive(QWidget *widget, int timeout = 1000) { - if (QWindow *window = widget->windowHandle()) + if (QWindow *window = widget->window()->windowHandle()) return qWaitForWindowActive(window, timeout); return false; } inline static bool qWaitForWindowExposed(QWidget *widget, int timeout = 1000) { - if (QWindow *window = widget->windowHandle()) + if (QWindow *window = widget->window()->windowHandle()) return qWaitForWindowExposed(window, timeout); return false; } |