QtTaskTree::Else Class
class QtTaskTree::Else条件表达式中使用的“else”元素。更多内容...
| 标题: | #include <qconditional.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS TaskTree) target_link_libraries(mytarget PRIVATE Qt6::TaskTree) |
| qmake: | QT += tasktree |
| 自: | Qt 6.11 |
| 状态: | 技术预览 |
该类处于技术预览阶段,内容可能会有变动。
注意:本类中的所有函数均为可重入函数。
公共函数
| Else(const QtTaskTree::GroupItems &children) | |
| Else(std::initializer_list<QtTaskTree::GroupItem> children) | |
| Else(QtTaskTree::Else &&other) |
详细说明
条件表达式中 else 分支的代码块。其前必须始终有Then 元素。
成员函数文档
[explicit] Else::Else(const QtTaskTree::GroupItems &children)
创建一个包含children 项的条件表达式的else分支主体元素。如果前一个条件以错误结束,则跳过前面的Then 主体,并选择this 分支。在这种情况下,正在运行的QTaskTree 会执行children ,而该执行的结果即为整个条件表达式的最终结果。
[explicit] Else::Else(std::initializer_list<QtTaskTree::GroupItem> children)
根据children ,从std::initializer_list 构建else分支体元素。
这是一个重载函数。
[constexpr noexcept default] Else::Else(QtTaskTree::Else &&other)
通过Move构造一个Else 的实例。
© 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.