QtTaskTree::QSingleTaskTreeRunner Class | Qt TaskTree | Qt 6.11.1
Description: A single task tree execution controller.

- Qt 6.11
- Qt TaskTree
- C++ Classes
- QSingleTaskTreeRunner
- Qt 6.11.1 Reference Documentation

# QtTaskTree::QSingleTaskTreeRunner Class

class QtTaskTree::QSingleTaskTreeRunner

A single task tree execution controller. More...

Header: | `#include <qtasktreerunner.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS TaskTree)` `target_link_libraries(mytarget PRIVATE Qt6::TaskTree)`
qmake: | `QT += tasktree`
Since: | Qt 6.11

- List of all members, including inherited members

## Public Functions

| QSingleTaskTreeRunner()
| ~QSingleTaskTreeRunner()
void | cancel()
bool | isRunning() const
void | reset()
void | start(const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDone callDone = QtTaskTree::CallDoneFlag::Always)

## 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.

See also Task Tree Runners.

## Member Function Documentation

### QSingleTaskTreeRunner::QSingleTaskTreeRunner()

Constructs a single task tree runner.

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

Destroys the single task tree runner. A possibly running task tree is deleted. No task tree's done handler is called.

See also ~QTaskTree().

### void QSingleTaskTreeRunner::cancel()

Cancels the running task tree. Calls task tree' done handler with DoneWith::Cancel.

### bool QSingleTaskTreeRunner::isRunning() const

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

### void QSingleTaskTreeRunner::reset()

Resets the running task tree. No task tree's done handler is called.

### template <typename SetupHandler = QtTaskTree::TreeSetupHandler, typename DoneHandler = QtTaskTree::TreeDoneHandler> void QSingleTaskTreeRunner::start(const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDone callDone = QtTaskTree::CallDoneFlag::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.