在本页

QtTaskTree::QMappedTaskTreeRunner Class

template <typename Key> class QtTaskTree::QMappedTaskTreeRunner

具有给定关键字类型的映射任务树执行控制器。更多

头文件: #include <qtasktreerunner.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS TaskTree)
target_link_libraries(mytarget PRIVATE Qt6::TaskTree)
qmake: QT += tasktree
Qt 6.11

公共函数

QMappedTaskTreeRunner()
~QMappedTaskTreeRunner()
void cancel()
void cancelKey(const Key &key)
bool isKeyRunning(const Key &key) const
bool isRunning() const
void reset()
void resetKey(const Key &key)
void start(const Key &key, const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDone callDone = QtTaskTree::CallDoneFlag::Always)

详细说明

使用Key 类型管理映射任务树的执行。使用start() 方法无条件执行给定键的配方,重置可能正在运行的具有相同键的任务树,并并行保留其他可能正在运行的具有不同键的任务树。

另请参阅 Task Tree Runners

成员函数文档

QMappedTaskTreeRunner::QMappedTaskTreeRunner()

构造映射任务树运行程序。Key 类型用于任务树映射。

QMappedTaskTreeRunner::~QMappedTaskTreeRunner()

销毁映射任务树运行程序。所有正在运行的任务树都会被删除。不会调用任务树的已完成处理程序。

另请参见 ~QTaskTree().

void QMappedTaskTreeRunner::cancel()

取消所有正在运行的任务树。使用DoneWith::Cancel 调用任务树的已完成处理程序。取消任务树的顺序是随机的。

void QMappedTaskTreeRunner::cancelKey(const Key &key)

取消使用key 启动的可能正在运行的任务树。使用DoneWith::Cancel 调用任务树的已完成处理程序。

bool QMappedTaskTreeRunner::isKeyRunning(const Key &key) const

返回映射任务树运行程序当前是否正在执行用key 启动的任务树。

bool QMappedTaskTreeRunner::isRunning() const

返回映射任务树运行程序当前是否正在执行至少一个任务树。

void QMappedTaskTreeRunner::reset()

重置所有正在运行的任务树。不会调用任务树的已完成处理程序。

void QMappedTaskTreeRunner::resetKey(const Key &key)

重置使用key 启动的可能正在运行的任务树。不会调用任务树的已完成处理程序。

template <typename SetupHandler = QtTaskTree::TreeSetupHandler, typename DoneHandler = QtTaskTree::TreeDoneHandler> void QMappedTaskTreeRunner::start(const Key &key, const QtTaskTree::Group &recipe, SetupHandler &&setupHandler = {}, DoneHandler &&doneHandler = {}, QtTaskTree::CallDone callDone = QtTaskTree::CallDoneFlag::Always)

无条件启动给定keyrecipe ,重置任何可能正在运行的具有相同密钥的任务树,并并行保留其他可能正在运行的具有不同密钥的任务树。当新任务树即将启动时,调用setupHandler 。当任务树结束时,调用doneHandler 。根据传递的callDone 调用doneHandler

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