- Extending Qt Creator Manual
- TaskTree
- QParallelTaskTreeRunner
- Extending Qt Creator Manual 19.0.0-beta2

# QParallelTaskTreeRunner Class

A parallel task tree execution controller. More...

Header: | `#include <qtasktreerunner.h>`
Inherits: | QAbstractTaskTreeRunner

- List of all members, including inherited members

## Public Functions

| QParallelTaskTreeRunner(QObject *parent = nullptr)
virtual | ~QParallelTaskTreeRunner()
void | start(const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDoneFlags callDone = QtTaskTree::CallDone::Always)

## Reimplemented Public Functions

virtual void | cancel() override
virtual bool | isRunning() const override
virtual void | reset() override

## Detailed Description

Manages parallel task tree execution. Use the start() method to execute a given recipe instantly, keeping other possibly running task trees in parallel.

## Member Function Documentation

### QParallelTaskTreeRunner::QParallelTaskTreeRunner(QObject *parent = nullptr)

Constructs a parallel task tree runner for the given parent.

### `[virtual noexcept]` QParallelTaskTreeRunner::~QParallelTaskTreeRunner()

Destroys the parallel task tree runner. All running task trees are deleted. No task trees' done handlers are called nor done() signals are emitted.

See also ~QTaskTree().

### `[override virtual]` void QParallelTaskTreeRunner::cancel()

Reimplements: QAbstractTaskTreeRunner::cancel().

Cancels all running task trees. Calls task trees' done handlers and emits done() signals with DoneWith::Cancel. The order of task trees' cancellation is random.

### `[override virtual]` bool QParallelTaskTreeRunner::isRunning() const

Reimplements: QAbstractTaskTreeRunner::isRunning() const.

Returns whether the parallel task tree runner is currently executing at least one task tree.

### `[override virtual]` void QParallelTaskTreeRunner::reset()

Reimplements: QAbstractTaskTreeRunner::reset().

Resets all running task trees. No task trees' done handlers are called nor done() signals are emitted.

### template <typename SetupHandler = QAbstractTaskTreeRunner::TreeSetupHandler, typename DoneHandler = QAbstractTaskTreeRunner::TreeDoneHandler> void QParallelTaskTreeRunner::start(const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDoneFlags callDone = QtTaskTree::CallDone::Always)

Starts the recipe instantly and keeps other possibly running task trees in parallel. Calls setupHandler when new task tree is about to be started. Calls doneHandler when the task tree is finished. The doneHandler is called according to the passed callDone.