summaryrefslogtreecommitdiff
path: root/tests/manual/tasktree/taskwidget.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-01-06 16:07:16 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-01-06 15:28:19 +0000
commitb6208ab34aa53280f06622edf1e3aa506aed96b6 (patch)
treeace91ca5f95f64e541bb4edcb789a3d7d1d904ae /tests/manual/tasktree/taskwidget.h
parentfbb8d94e55bccfda87e97d4ad203575bf0ab88a2 (diff)
downloadqt-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.h')
-rw-r--r--tests/manual/tasktree/taskwidget.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/manual/tasktree/taskwidget.h b/tests/manual/tasktree/taskwidget.h
index be21ae02e9..7421ca5a30 100644
--- a/tests/manual/tasktree/taskwidget.h
+++ b/tests/manual/tasktree/taskwidget.h
@@ -22,6 +22,11 @@ enum class State {
Error
};
+enum class ExecuteMode {
+ Sequential, // default
+ Parallel
+};
+
class StateWidget : public QWidget
{
public:
@@ -54,8 +59,8 @@ class GroupWidget : public StateWidget
public:
GroupWidget();
- void setExecuteMode(Utils::Tasking::ExecuteMode mode);
- Utils::Tasking::ExecuteMode executeMode() const;
+ void setExecuteMode(ExecuteMode mode);
+ Utils::Tasking::ParallelLimit executeMode() const;
void setWorkflowPolicy(Utils::Tasking::WorkflowPolicy policy);
Utils::Tasking::WorkflowPolicy workflowPolicy() const;
@@ -67,7 +72,7 @@ private:
QComboBox *m_executeCombo = nullptr;
QComboBox *m_workflowCombo = nullptr;
- Utils::Tasking::ExecuteMode m_executeMode = Utils::Tasking::ExecuteMode::Sequential;
+ ExecuteMode m_executeMode = ExecuteMode::Sequential;
Utils::Tasking::WorkflowPolicy m_workflowPolicy = Utils::Tasking::WorkflowPolicy::StopOnError;
};