diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-31 11:56:53 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-31 21:50:37 +0200 |
commit | 00d9f68c411a336e451065ae71b8d0fb0d44da60 (patch) | |
tree | 7b683601e3d0be4f682c4d55932a5b99c9782956 /tests | |
parent | ae653fc08b3dd670f8f9a7c49f861107ed61266f (diff) |
Speed up tst_QApplication::testDeleteLaterProcessEvents2()
Quit the event loop once the object is destroyed.
Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index a7a000a01e..3debfd4231 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -1366,10 +1366,11 @@ void tst_QApplication::testDeleteLaterProcessEvents2() // If you call deleteLater() on an object when there is no parent // event loop, and then enter an event loop, the object will get // deleted. + QEventLoop loop; object = new QObject; + connect(object, &QObject::destroyed, &loop, &QEventLoop::quit); p = object; object->deleteLater(); - QEventLoop loop; QTimer::singleShot(1000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY(!p); |