summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-06 01:00:35 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-06 15:45:11 +0200
commit864048a8f5625b252bb2ac63812fd3edb7361343 (patch)
tree5c9339c80f7a1a6d0725031626fa5fcf1e2fbd19 /tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
parent1c23d34ad4bdd67dec6d501d91087823dc9ea358 (diff)
parent4ee7adf59d13ada5bfaa4f0382e0bb70b66b8814 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/corelib/kernel/qeventdispatcher_win.cpp Change-Id: I32db3f755577aefc15f757041367d6144f5e5c66
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 fa448a9593..9ab7e4e315 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;
}