QtTaskTree::QSingleTaskTreeRunner Class
class QtTaskTree::QSingleTaskTreeRunnerA 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 |
| Status: | Technical Preview |
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 nor done() signal is emitted.
See also ~QTaskTree().
void QSingleTaskTreeRunner::cancel()
Cancels the running task tree. Calls task tree' done handler and emits done() signal 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 nor done() signal is emitted.
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.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.