- Extending Qt Creator Manual
- QtTaskTree
- QSingleTaskTreeRunner
- Extending Qt Creator Manual 20.0.0-beta1

# 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: | 6.11

- List of all members, including inherited members

## Public Functions

| ~QSingleTaskTreeRunner()
QtTaskTree::Q_TASKTREE_EXPORT | cancel()
QtTaskTree::Q_TASKTREE_EXPORT | isRunning() const
QtTaskTree::Q_TASKTREE_EXPORT | 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

### `[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().

### QtTaskTree::Q_TASKTREE_EXPORT QSingleTaskTreeRunner::cancel()

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

### QtTaskTree::Q_TASKTREE_EXPORT QSingleTaskTreeRunner::isRunning() const

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

### QtTaskTree::Q_TASKTREE_EXPORT 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.