QSingleTaskTreeRunner Class

A single task tree execution controller. More...

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

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.

© 2025 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.