QtTaskTree::ElseIf Class
class QtTaskTree::ElseIf条件表达式中使用的“else if”子句。更多内容...
| 标题: | #include <qconditional.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS TaskTree) target_link_libraries(mytarget PRIVATE Qt6::TaskTree) |
| qmake: | QT += tasktree |
| 自: | Qt 6.11 |
| 状态: | 技术预览版 |
该类处于技术预览阶段,内容可能会有变动。
注意:本类中的所有函数均为可重入函数。
公共函数
| ElseIf(const QtTaskTree::ExecutableItem &condition) | |
| ElseIf(Handler &&handler) | |
| ElseIf(QtTaskTree::ElseIf &&other) |
详细说明
条件表达式中的替代条件元素。其前后必须始终由Then 元素包围。
成员函数文档
[explicit] ElseIf::ElseIf(const QtTaskTree::ExecutableItem &condition)
创建一个包含condition 任务的替代条件元素,用于条件表达式中。
另请参阅 If 。
[explicit] template <typename Handler, std::enable_if_t<!std::is_base_of_v<ExecutableItem, std::decay_t<Handler>>, bool> = true> ElseIf::ElseIf(Handler &&handler)
一个辅助构造函数,用于接收在运行中的 `QTaskTree` 评估初始条件时要执行的同步 `handler `。
这是以下代码的快捷写法:
ElseIf (QSyncTask(handler))有关可接受的处理程序类型的更多信息,请参阅QSyncTask 。
这是一个重载函数。
[constexpr noexcept default] ElseIf::ElseIf(QtTaskTree::ElseIf &&other)
通过 Move 构造一个ElseIf 的实例。
© 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.