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

# QSingleTaskTreeRunner Class

A single task tree execution controller. More...

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

- List of all members, including inherited members

## Public Functions

| QSingleTaskTreeRunner(QObject *parent = nullptr)
virtual | ~QSingleTaskTreeRunner() override
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 single task tree execution. Use the start() method to execute a given recipe, resetting any possibly running task tree. It's guaranteed that at most one task tree is executing at any given time.

## Member Function Documentation

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

Constructs a single task tree runner for the given parent.

### `[override virtual noexcept]` QSingleTaskTreeRunner::~QSingleTaskTreeRunner()

Destroys the single task tree runner. A possibly running task tree is deleted. No task tree's done handler is called nor done() signal is emitted.

See also ~QTaskTree().

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

Reimplements: QAbstractTaskTreeRunner::cancel().

Cancels the running task tree. Calls task tree' done handler and emits done() signal with DoneWith::Cancel.

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

Reimplements: QAbstractTaskTreeRunner::isRunning() const.

Returns whether the single task tree runner is currently executing a task tree.

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

Reimplements: QAbstractTaskTreeRunner::reset().

Resets the running task tree. No task tree's done handler is called nor done() signal is emitted.

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

Starts the recipe unconditionally, resetting any possibly running task tree. 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.