- Qt 6.12
- Qt TaskTree
- C++ Classes
- QDefaultTaskAdapter
- Qt 6.12.0 Reference Documentation

# QtTaskTree::QDefaultTaskAdapter Class

template <typename Task> class QtTaskTree::QDefaultTaskAdapter

A class template providing default task adapter used in QCustomTask. More...

Header: | `#include <qtasktree.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS TaskTree)` `target_link_libraries(mytarget PRIVATE Qt6::TaskTree)`
qmake: | `QT += tasktree`
Since: | Qt 6.11
Status: | Technology preview

This class is in technology preview and is subject to change.

Note: All functions in this class are reentrant.

## Detailed Description

QDefaultTaskAdapter<Task> is a template class where Task specifies the task type to adapt.

The QDefaultTaskAdapter adapting Task may be used when the following conditions are met:

1. The Task is derived from QObject.
2. The Task has public start() method that starts the task.
3. The Task emits done(QtTaskTree::DoneResult) or done(bool) signal when it's finished.

If any of these conditions isn't met, you should provide your custom Adapter type adapting the Task type, to the QCustomTask<Task, Adapter> class template.