Handle DeferredDelete events in Tools::wait().

This commit is contained in:
Felix Geyer 2012-11-02 11:07:44 +01:00
parent 8347fd36ba
commit 6b3fed1ce5

View File

@ -189,6 +189,7 @@ void wait(int ms)
if (ms <= 50) {
QCoreApplication::processEvents(QEventLoop::AllEvents, ms);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
sleep(qMax(ms - static_cast<int>(timer.elapsed()), 0));
}
else {
@ -197,6 +198,7 @@ void wait(int ms)
timeLeft = ms - timer.elapsed();
if (timeLeft > 0) {
QCoreApplication::processEvents(QEventLoop::AllEvents, timeLeft);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
sleep(10);
}
} while (timer.elapsed() < ms);