在本页

QtTaskTree::Forever Class

class QtTaskTree::Forever

无限循环的子任务。更多

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

注意:该类中的所有函数都是可重入的

公共函数

Forever(const QtTaskTree::GroupItems &children)
Forever(std::initializer_list<QtTaskTree::GroupItem> children)

详细说明

传递给构造函数的任务将重复执行,直到其中某个任务导致主体的工作流策略停止执行。默认情况下,正文将重复执行,直到某个任务结束时出现错误。

有关将组处理程序和Storage 作为 Forever 主体的直接子节点的更多信息,请参阅Do 文档。

另请参阅 ForForeverIterator

成员函数文档

[explicit] Forever::Forever(const QtTaskTree::GroupItems &children)

构造一个无限循环,执行children

下面的构造

const Group recipe = Forever {
    task1,
    task2
};

等价于

const Group recipe = For (ForeverIterator()) >> Do {
    task1,
    task2
};

[explicit] Forever::Forever(std::initializer_list<QtTaskTree::GroupItem> children)

构造一个无限循环,执行作为初始化列表传递的children

这是一个重载函数。

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