QTime dieTime = QTime::currentTime().addMSecs(1000); while( QTime::currentTime() < dieTime ) QCoreApplication::processEvents(QEventLoop::AllEvents, 100);