Created
May 18, 2019 09:45
-
-
Save jnareb/5a513d25c89aee09aa060d0bedd060cb to your computer and use it in GitHub Desktop.
Nieblokujące opóźnienie w aplikacjach napisanych za pomocą biblioteki Qt (np. do animacji)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MainWindow::delay(int ms) | |
{ | |
QTime endTime = QTime::currentTime().addMSecs(ms); | |
while (QTime::currentTime() < endTime) | |
QCoreApplication::processEvents(QEventLoop::AllEvents, 100 /* maxtime in ms */); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment