The QTaskBuilder class is used for adjusting task parameters. More...
Header: | #include <QTaskBuilder> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Concurrent) target_link_libraries(mytarget PRIVATE Qt6::Concurrent) |
qmake: | QT += concurrent |
Since: | Qt 6.0 |
QTaskBuilder<Task, Args...> & | onThreadPool(QThreadPool &newThreadPool) |
QFuture<QtConcurrent::InvokeResultType> | spawn() |
void | spawn(QtConcurrent::FutureResult) |
QTaskBuilder<Task, ExtraArgs...> | withArguments(ExtraArgs &&... args) |
QTaskBuilder<Task, Args...> & | withPriority(int newPriority) |
It's not possible to create an object of this class manually. See Concurrent Task for more details and usage examples.
Sets the thread pool newThreadPool that the task will be invoked on.
Runs the task in a separate thread and returns a future object immediately. This is a non-blocking call. The task might not start immediately.
Runs the task in a separate thread. This is a non-blocking call. The task might not start immediately.
Sets the arguments args the task will be invoked with. The code is ill-formed (causes compilation errors) if:
Sets the priority newPriority that the task will be invoked with.
[alias]
InvokeResultTypeThe simplified definition of this type looks like this:
template <class Task, class ...Args> using InvokeResultType = std::invoke_result_t<std::decay_t<Task>, std::decay_t<Args>...>;
The real implementation also contains a compile-time check for whether the task can be invoked with the specified arguments or not.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: