From 407d076124d42a1f4911e139ffb2d77a117ef277 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 11 Feb 2022 17:03:51 +0100 Subject: [PATCH] Remove mentions of QtConcurrent::runWithPromise from docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jarek Kobus Reviewed-by: Leena Miettinen --- src/concurrent/qtconcurrentrun.cpp | 17 ++++++++--------- src/concurrent/qtconcurrentrun.h | 6 ------ src/corelib/thread/qpromise.qdoc | 4 +++- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index 18bcf332ac5..143b9bb6f29 100644 --- a/src/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp @@ -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 &} type, where - T is the type of the computation result (it should match the type T - of QFuture 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 &} type, where + \c T is the type of the computation result (it should match the type \c T + of QFuture 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: diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h index 4ce8d6ae05e..b3790be2e36 100644 --- a/src/concurrent/qtconcurrentrun.h +++ b/src/concurrent/qtconcurrentrun.h @@ -61,12 +61,6 @@ namespace QtConcurrent { template QFuture run(QThreadPool *pool, Function function, ...); - template - QFuture runWithPromise(Function function, ...); - - template - QFuture runWithPromise(QThreadPool *pool, Function function, ...); - } // namespace QtConcurrent #else diff --git a/src/corelib/thread/qpromise.qdoc b/src/corelib/thread/qpromise.qdoc index f9040d4cd10..a462135d96c 100644 --- a/src/corelib/thread/qpromise.qdoc +++ b/src/corelib/thread/qpromise.qdoc @@ -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=() */