summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2011-11-11 11:33:41 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-15 04:32:20 +0100
commitb4d23e61ed19c770caf6b993a8ab0e4474d3f417 (patch)
tree96ee2811976b214f9298ae08dcad8774c9b9f787
parentc1c51dd4f7002bedee996e498d3333e5eabf2ddc (diff)
Make QTest::qWait() handle DeferredDelete event
The QTest::qWait() function does not handle DeferredDelete, in this case all deleteLater() calls before the qWait() won't be processed during the wait. Add an explicit sendPostedEvents(0, QEvent::DeferredDelete) to fix this problem. Task-number:QTBUG-22633 Change-Id: I2c5574b4e7d3c070fad6382dc36ddfd1dfac50d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
-rw-r--r--src/testlib/qtestsystem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h
index 0165e51528..6a87fe3460 100644
--- a/src/testlib/qtestsystem.h
+++ b/src/testlib/qtestsystem.h
@@ -68,6 +68,7 @@ namespace QTest
timer.start();
do {
QCoreApplication::processEvents(QEventLoop::AllEvents, ms);
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QTest::qSleep(10);
} while (timer.elapsed() < ms);
}
@@ -97,3 +98,4 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif
+