summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 3debfd4231..28bf851d37 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -1229,6 +1229,11 @@ void DeleteLaterWidget::runTest()
QCoreApplication::processEvents();
+ // At this point, the event queue is empty. As we want a deferred
+ // deletion to occur before the timer event, we should provoke the
+ // event dispatcher for the next spin.
+ QCoreApplication::eventDispatcher()->interrupt();
+
QVERIFY(!stillAlive); // verify at the end to make test terminate
}
@@ -1258,8 +1263,10 @@ void tst_QApplication::testDeleteLater()
QObject *stillAlive = wgt->findChild<QObject*>("deleteLater");
QVERIFY(stillAlive);
+ wgt->show();
QCoreApplication::exec();
+ QVERIFY(wgt->isHidden());
delete wgt;
}