在本页

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)

详细说明

条件表达式的替代条件元素。必须始终在Then 元素之前和之后。

另请参阅 If,Then, 和Else

成员函数文档

[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

这是一个重载函数。

另请参见 QSyncTaskIf

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