Set progress bar timer to 500ms.
Yield thread to give worker thread its share of CPU time.
This commit is contained in:
parent
9eb458c4c5
commit
ed6df98653
@ -87,7 +87,7 @@ void MainWindow::customEvent(QEvent *event) {
|
|||||||
m_progressValue = progress;
|
m_progressValue = progress;
|
||||||
ui->updateProgress->setValue(progress/10);
|
ui->updateProgress->setValue(progress/10);
|
||||||
QApplication::postEvent(this, new ProgressEvent(this, progress+10));
|
QApplication::postEvent(this, new ProgressEvent(this, progress+10));
|
||||||
QThread::msleep(100);
|
QThread::msleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,6 +110,8 @@ void MainWindow::customEvent(QEvent *event) {
|
|||||||
qCritical() << "!!! UNKNOWN SENDER !!!";
|
qCritical() << "!!! UNKNOWN SENDER !!!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QThread::yieldCurrentThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onStopStartTimer() {
|
void MainWindow::onStopStartTimer() {
|
||||||
|
Loading…
Reference in New Issue
Block a user