Remove mentions of QtConcurrent::runWithPromise from docs

cf043a785ac9357e8f1283ea9e1496261af2b1a5 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:
Sona Kurazyan 2022-02-11 17:03:51 +01:00
parent 815bc61626
commit 407d076124
3 changed files with 11 additions and 16 deletions

View File

@ -167,18 +167,17 @@
\section2 The mandatory QPromise argument \section2 The mandatory QPromise argument
The function passed to QtConcurrent::run() in \e {Run With Promise} mode is expected The function passed to QtConcurrent::run() in \e {Run With Promise} mode
to have an additional argument of \c {QPromise<T> &} type, where 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 \c T is the type of the computation result (it should match the type \c T
of QFuture<T> returned by the QtConcurrent::runWithPromise()), like e.g.: of QFuture<T> returned by QtConcurrent::run()), like e.g.:
\snippet code/src_concurrent_qtconcurrentrun.cpp 9 \snippet code/src_concurrent_qtconcurrentrun.cpp 9
The \c promise argument is instantiated inside the The \c promise argument is instantiated inside the QtConcurrent::run()
QtConcurrent::run() function, and its reference function, and its reference is passed to the invoked \c aFunction, so the
is passed to the invoked \c aFunction, so the user user doesn't need to instantiate it, nor pass it explicitly
doesn't need to instantiate it by himself, nor pass it explicitly when calling QtConcurrent::run() in this mode.
when calling QtConcurrent::runWithPromise().
The additional argument of QPromise type always needs to appear The additional argument of QPromise type always needs to appear
as a first argument on function's arguments list, like: as a first argument on function's arguments list, like:

View File

@ -61,12 +61,6 @@ namespace QtConcurrent {
template <typename T> template <typename T>
QFuture<T> run(QThreadPool *pool, Function function, ...); 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 } // namespace QtConcurrent
#else #else

View File

@ -83,7 +83,9 @@
\internal \internal
Constructs a QPromise with a passed QFutureInterface \a other. 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=() \sa operator=()
*/ */