本页内容

QtTaskTree::Then Class

class QtTaskTree::Then

条件表达式中使用的“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)
Then(QtTaskTree::Then &&other)

详细说明

条件表达式的一个分支体元素。其前面必须始终是If 或ElseIf 元素。其后面可以是Else 或ElseIf 元素。

另请参阅 If 、Else 和ElseIf 。

成员函数文档

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

创建一个包含children 项的分支主体元素,用于条件表达式。如果前面的If 或ElseIf 元素成功执行完毕,则正在运行的QTaskTree 将执行children ,而该执行的结果即为整个条件表达式的最终结果。

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

根据children ,从std::initializer_list 构建一个分支主体元素。

这是一个重载函数。

[constexpr noexcept default] Then::Then(QtTaskTree::Then &&other)

通过Move构造一个Then 的实例。

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