在本页

QtTaskTree::Then Class

class QtTaskTree::Then

条件表达式中使用的 "则 "元素。更多

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

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

公共函数

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

详细说明

条件表达式的分支主体元素。其前面必须始终有IfElseIf 元素。其后可以是ElseElseIf 元素。

另请参见 If,Else, 和ElseIf

成员函数文档

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

创建一个包含children 项的分支主体元素,用于条件表达式。如果前一个IfElseIf 元素执行成功,运行中的QTaskTree 会执行children ,执行结果就是整个条件表达式的最终结果。

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

std::initializer_list 中构造一个分支主体元素,该元素由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.