- Extending Qt Creator Manual
- TaskingSolution
- TaskInterface
- Extending Qt Creator Manual 14.0.0-rc1

# TaskInterface Class

class Tasking::TaskInterface

TaskInterface is the abstract base class for implementing custom task adapters. More...

Header: | #include <solutions/tasking/tasktree.h>
Inherited By: | Tasking::TaskAdapter

- List of all members, including inherited members

Note: All functions in this class are reentrant.

## Signals

void | done(Tasking::DoneResult result)

## Protected Functions

virtual void | start() = 0

## Detailed Description

To implement a custom task adapter, derive your adapter from the `TaskAdapter<Task>` class template. TaskAdapter automatically creates and destroys the custom task instance and associates the adapter with a given `Task` type.

## Member Function Documentation

### `[signal]` void TaskInterface::done(Tasking::DoneResult result)

Emit this signal from the `TaskAdapter<Task>`'s subclass, when the `Task` is finished. Pass DoneResult::Success as a result argument when the task finishes with success; otherwise, when an error occurs, pass DoneResult::Error.

### `[pure virtual protected]` void TaskInterface::start()

This method is called by the running TaskTree for starting the `Task` instance. Reimplement this method in `TaskAdapter<Task>`'s subclass in order to start the associated task.

Use TaskAdapter::task() to access the associated `Task` instance.

See also done() and TaskAdapter::task().