diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-01-06 16:07:16 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-01-06 15:28:19 +0000 |
commit | b6208ab34aa53280f06622edf1e3aa506aed96b6 (patch) | |
tree | ace91ca5f95f64e541bb4edcb789a3d7d1d904ae /tests/manual/tasktree/taskwidget.cpp | |
parent | fbb8d94e55bccfda87e97d4ad203575bf0ab88a2 (diff) | |
download | qt-creator-b6208ab34aa53280f06622edf1e3aa506aed96b6.tar.gz |
TaskTree: Introduce ParallelLimit
The parallel limit constrains the number of parallel tasks
run in the same time. So, if e.g. a group contains 10 children
and the parallel limit is 6, only first 6 tasks are being started
on the beginning and the rest 4 are being postponed until some
running tasks are finished. So, when the one of 6 running tasks
finishes the group starts the 7th task and so on.
Setting parallel limit to 1 means sequential invocation in fact.
The value of 0 means there is no limit and all tasks are run at once.
Remove the ExecuteMode enum, as this is modelled now by the
parallelLimit.
Change-Id: Ice59318be0915401f05bb5a5804078bdc591d09f
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'tests/manual/tasktree/taskwidget.cpp')
-rw-r--r-- | tests/manual/tasktree/taskwidget.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/manual/tasktree/taskwidget.cpp b/tests/manual/tasktree/taskwidget.cpp index a6901f8d13..d4ddc0194a 100644 --- a/tests/manual/tasktree/taskwidget.cpp +++ b/tests/manual/tasktree/taskwidget.cpp @@ -121,11 +121,11 @@ GroupWidget::GroupWidget() { m_stateIndicator->setFixedWidth(30); - m_executeCombo->addItem("Sequential", (int)Tasking::ExecuteMode::Sequential); - m_executeCombo->addItem("Parallel", (int)Tasking::ExecuteMode::Parallel); + m_executeCombo->addItem("Sequential", (int)ExecuteMode::Sequential); + m_executeCombo->addItem("Parallel", (int)ExecuteMode::Parallel); updateExecuteMode(); connect(m_executeCombo, &QComboBox::currentIndexChanged, this, [this](int index) { - m_executeMode = (Tasking::ExecuteMode)m_executeCombo->itemData(index).toInt(); + m_executeMode = (ExecuteMode)m_executeCombo->itemData(index).toInt(); }); m_workflowCombo->addItem("Stop On Error", (int)Tasking::WorkflowPolicy::StopOnError); @@ -152,7 +152,7 @@ GroupWidget::GroupWidget() setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); } -void GroupWidget::setExecuteMode(Tasking::ExecuteMode mode) +void GroupWidget::setExecuteMode(ExecuteMode mode) { m_executeMode = mode; updateExecuteMode(); @@ -163,9 +163,9 @@ void GroupWidget::updateExecuteMode() m_executeCombo->setCurrentIndex(m_executeCombo->findData((int)m_executeMode)); } -Tasking::ExecuteMode GroupWidget::executeMode() const +Tasking::ParallelLimit GroupWidget::executeMode() const { - return m_executeMode; + return m_executeMode == ExecuteMode::Sequential ? Tasking::sequential : Tasking::parallel; } void GroupWidget::setWorkflowPolicy(Tasking::WorkflowPolicy policy) |