4#ifndef QTBASE_QTTASKBUILDER_H
5#define QTBASE_QTTASKBUILDER_H
7#if !defined(QT_NO_CONCURRENT) || defined(Q_QDOC)
9#include <QtConcurrent/qtconcurrentstoredfunctioncall.h>
21template <
class Task,
class ...Args>
30 template <
class ...ExtraArgs>
49template <
class Task,
class ...Args>
57 std::move(taskWithArgs), startParameters);
64 ->start(startParameters);
67 template <
class ...ExtraArgs>
71 static_assert(std::tuple_size_v<TaskWithArgs> == 1,
72 "This function cannot be invoked if "
73 "arguments have already been passed.");
75 static_assert(
sizeof...(ExtraArgs) >= 1,
76 "One or more arguments must be passed.");
81 std::get<0>(std::move(taskWithArgs)),
82 std::forward<ExtraArgs>(
args)...
96 startParameters.
priority = newPriority;
108 , startParameters{parameters}
117 template <
class T,
class ...A>
123 TaskWithArgs taskWithArgs;
constexpr auto withArguments(ExtraArgs &&...args)
friend constexpr auto task(T &&t)
constexpr QTaskBuilder(Task &&task, Args &&...arguments)
constexpr QTaskBuilder(const TaskStartParameters ¶meters, Task &&task, Args &&...arguments)
constexpr auto & onThreadPool(QThreadPool &newThreadPool)
friend class QTaskBuilder
constexpr auto & withPriority(int newPriority)
QList< QVariant > arguments
Combined button and popup list for selecting options.
typename InvokeResult< Function, Args... >::Type InvokeResultType
std::tuple< std::decay_t< Types >... > DecayedTuple
auto run(QThreadPool *pool, Function &&f, Args &&...args)