QtConcurrent Namespace▲
-
Header: QtConcurrent
-
Since: Qt 4.4
-
qmake: QT += concurrent
-
Group: QtConcurrent is part of thread
Detailed Description▲
See the Qt Concurrent module documentation for an overview of available functions, or see below for detailed information on each function.
Type Documentation▲
enum QtConcurrent::ReduceOption▲
This enum specifies the order of which results from the map or filter function are passed to the reduce function.
Constant |
Value |
Description |
---|---|---|
QtConcurrent::UnorderedReduce |
0x1 |
Reduction is done in an arbitrary order. |
QtConcurrent::OrderedReduce |
0x2 |
Reduction is done in the order of the original sequence. |
QtConcurrent::SequentialReduce |
0x4 |
Reduction is done sequentially: only one thread will enter the reduce function at a time. (Parallel reduction might be supported in a future version of Qt Concurrent.) |
Function Documentation▲
int QtConcurrent::run(Function, ...)▲
Equivalent to
QtConcurrent::
run(QThreadPool::
globalInstance(), function, ...);
Runs function in a separate thread. The thread is taken from the global QThreadPool. Note that function may not run immediately; function will only be run once a thread becomes available.
T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function.
The QFuture returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started.
See Also▲
See also Concurrent Run
[since 5.4] int QtConcurrent::run(int *, Function, ...)▲
Runs function in a separate thread. The thread is taken from the QThreadPool pool. Note that function may not run immediately; function will only be run once a thread becomes available.
T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function.
The QFuture returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started.
This function was introduced in Qt 5.4.
See Also▲
See also Concurrent Run