Merge pull request #758 from flowln/fix_process_events_backstab

This commit is contained in:
Sefa Eyeoglu
2023-01-23 23:58:41 +01:00
committed by GitHub
2 changed files with 62 additions and 2 deletions

View File

@ -110,14 +110,14 @@ void ConcurrentTask::startNext()
setStepStatus(next->isMultiStep() ? next->getStepStatus() : next->getStatus());
updateState();
QCoreApplication::processEvents();
QMetaObject::invokeMethod(next.get(), &Task::start, Qt::QueuedConnection);
// Allow going up the number of concurrent tasks in case of tasks being added in the middle of a running task.
int num_starts = m_total_max_size - m_doing.size();
for (int i = 0; i < num_starts; i++)
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
QCoreApplication::processEvents();
}
void ConcurrentTask::subTaskSucceeded(Task::Ptr task)