Set progress bar timer to 500ms.
Yield thread to give worker thread its share of CPU time.
This commit is contained in:
@@ -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() {
|
||||||
|
Reference in New Issue
Block a user