QtTaskTree::QDefaultTaskAdapter Class
template <typename Task> class QtTaskTree::QDefaultTaskAdapter一个提供默认任务适配器的类模板,用于QCustomTask 。更多
| 头文件: | #include <qtasktree.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS TaskTree)target_link_libraries(mytarget PRIVATE Qt6::TaskTree) |
| qmake: | QT += tasktree |
| 自 | Qt 6.11 |
注意:该类中的所有函数都是可重入的。
详细说明
当满足以下条件时,可使用 QDefaultTaskAdapter 适配任务:
- 任务源于QObject 。
- 任务具有启动任务的公共 start() 方法。
- 任务完成时发出 done(QtTaskTree::DoneResult) 或 done(bool) 信号。
如果不满足这些条件中的任何一个,则应根据QCustomTask<Task, Adapter> 类模板提供适应任务类型的自定义适配器类型。
© 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.