diff options
-rw-r--r-- | src/qmltest/quicktest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 8fe9da5e09..1a5cad5d5a 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -57,6 +57,7 @@ #include <QtCore/qdebug.h> #include <QtCore/qeventloop.h> #include <QtCore/qtextstream.h> +#include <QtCore/qtimer.h> #include <QtGui/qtextdocument.h> #include <stdio.h> #include <QtGui/QGuiApplication> @@ -577,7 +578,10 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate()."; } if (view.isExposed()) { - QTestRootObject::instance()->setWindowShown(true); + // Defer property update until event loop has started + QTimer::singleShot(0, []() { + QTestRootObject::instance()->setWindowShown(true); + }); } else { qWarning().nospace() << "Test '" << QDir::toNativeSeparators(path) << "' window was never exposed! " |