From 2debae1600a3f7f997115e277cb08747d4549f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 16 Dec 2016 15:48:00 +0100 Subject: 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 --- src/testlib/qtestsystem.h | 4 ++-- 1 file 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; } -- cgit v1.2.3