Gui: [skip ci] fix crash in SequencerBar::setProgress or SequencerDialog::setProgress when used in worker threads

This commit is contained in:
wmayer
2021-04-28 12:02:52 +02:00
parent 0909fa76aa
commit 545d055766
2 changed files with 18 additions and 2 deletions

View File

@@ -152,7 +152,15 @@ void SequencerDialog::nextStep(bool canAbort)
void SequencerDialog::setProgress(size_t step)
{
d->dlg->show();
QThread* currentThread = QThread::currentThread();
QThread* thr = d->dlg->thread(); // this is the main thread
if (thr != currentThread) {
QMetaObject::invokeMethod(d->dlg, "show", Qt::QueuedConnection);
}
else {
d->dlg->show();
}
setValue((int)step);
}