
Originally Posted by
sangee
QTime dieTime= QTime::currentTime().addMSecs(10);
while( QTime::currentTime() < dieTime )
QCoreApplication:

rocessEvents(QEventLoop::AllEvents, 100);
I used this code for delay processing in my project.but I don't know how to stop this delay processing in loop execution?
And when the time changes from summer to winter you wait an hour. For this type of calculation, use QElapsedTimer which is insensitive to change the clock settings on your computer. A more elegant solution :
QTimer::singleShot( how_long_ms,
&my_loop,
SLOT(quit
()) );
loop.exec();
QEventLoop my_loop;
QTimer::singleShot( how_long_ms,&my_loop,SLOT(quit()) );
loop.exec();
To copy to clipboard, switch view to plain text mode
Bookmarks