summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qcommandlinkbutton
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qcommandlinkbutton')
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index b18e095a93..ae776f536b 100644
--- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -386,6 +386,12 @@ void tst_QCommandLinkButton::setAccel()
// The shortcut will not be activated unless the button is in a active
// window and has focus
testWidget->setFocus();
+
+ // QWidget::isActiveWindow() can report window active before application
+ // has handled the asynchronous activation event on platforms that have
+ // implemented QPlatformWindow::isActive(), so process events to sync up.
+ QApplication::instance()->processEvents();
+
for (int i = 0; !testWidget->isActiveWindow() && i < 1000; ++i) {
testWidget->activateWindow();
QApplication::instance()->processEvents();