diff options
author | Daiwei Li <daiweili@suitabletech.com> | 2015-01-23 14:42:33 -0800 |
---|---|---|
committer | Daiwei Li <daiweili@suitabletech.com> | 2015-02-03 02:04:40 +0000 |
commit | 81b876b7177cf0d55b7c009342e501bfa900175c (patch) | |
tree | 11546fa5d7e25e066bc03a72f7058c8c7d2bc628 /src/qmltest | |
parent | 5df747fc5300f9c7e1da0fb86bab68209c921c9c (diff) |
qquicktest: Wait for the view to finish loading
Tests can be skipped if the view is still loading by the time we get
to the end of the loop. There is a case where the window is active
but the QML hasn't been loaded.
Change-Id: I4e8346ee547653810458d042925d673748c1fec8
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/qmltest')
-rw-r--r-- | src/qmltest/quicktest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index bef20c6464..0c8bfab1fa 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -362,6 +362,10 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD } view->show(); view->requestActivate(); + + while (view->status() == QQuickView::Loading) + QTest::qWait(10); + QTest::qWaitForWindowActive(view); if (view->isExposed()) QTestRootObject::instance()->setWindowShown(true); |