Remove mentions of QtConcurrent::runWithPromise from docs
cf043a785a
unified QtConcurrent::run() and
QtConcurrent::runWithPromise(). Remove the last mentions of
runWithPromise. Also did some minor cosmetic improvements.
Pick-to: 6.3
Change-Id: Ie3b39600978ccfa4a009d3ff68567a348dc7b166
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
parent
815bc61626
commit
407d076124
@ -167,18 +167,17 @@
|
||||
|
||||
\section2 The mandatory QPromise argument
|
||||
|
||||
The function passed to QtConcurrent::run() in \e {Run With Promise} mode is expected
|
||||
to have an additional argument of \c {QPromise<T> &} type, where
|
||||
T is the type of the computation result (it should match the type T
|
||||
of QFuture<T> returned by the QtConcurrent::runWithPromise()), like e.g.:
|
||||
The function passed to QtConcurrent::run() in \e {Run With Promise} mode
|
||||
is expected to have an additional argument of \c {QPromise<T> &} type, where
|
||||
\c T is the type of the computation result (it should match the type \c T
|
||||
of QFuture<T> returned by QtConcurrent::run()), like e.g.:
|
||||
|
||||
\snippet code/src_concurrent_qtconcurrentrun.cpp 9
|
||||
|
||||
The \c promise argument is instantiated inside the
|
||||
QtConcurrent::run() function, and its reference
|
||||
is passed to the invoked \c aFunction, so the user
|
||||
doesn't need to instantiate it by himself, nor pass it explicitly
|
||||
when calling QtConcurrent::runWithPromise().
|
||||
The \c promise argument is instantiated inside the QtConcurrent::run()
|
||||
function, and its reference is passed to the invoked \c aFunction, so the
|
||||
user doesn't need to instantiate it, nor pass it explicitly
|
||||
when calling QtConcurrent::run() in this mode.
|
||||
|
||||
The additional argument of QPromise type always needs to appear
|
||||
as a first argument on function's arguments list, like:
|
||||
|
@ -61,12 +61,6 @@ namespace QtConcurrent {
|
||||
template <typename T>
|
||||
QFuture<T> run(QThreadPool *pool, Function function, ...);
|
||||
|
||||
template <typename T>
|
||||
QFuture<T> runWithPromise(Function function, ...);
|
||||
|
||||
template <typename T>
|
||||
QFuture<T> runWithPromise(QThreadPool *pool, Function function, ...);
|
||||
|
||||
} // namespace QtConcurrent
|
||||
|
||||
#else
|
||||
|
@ -83,7 +83,9 @@
|
||||
|
||||
\internal
|
||||
Constructs a QPromise with a passed QFutureInterface \a other.
|
||||
Used internally for QtConcurrent::runWithPromise.
|
||||
Used internally for QtConcurrent::run(), when its callable takes
|
||||
a reference to the associated promise as its first argument
|
||||
(run with promise mode).
|
||||
|
||||
\sa operator=()
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user