From 086a08dcf9f2f1b6745a0a01a0f54668a0bb7dd8 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 22 Nov 2021 11:01:43 +0100 Subject: Mention QtFuture::when* functions in QFuture's docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also fix an unrelated minor issue in QtFuture::whenAll docs. Task-number: QTBUG-86714 Change-Id: I45f06b17db0508be10215e6d260ef76ede3077fb Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/corelib/thread/qfuture.qdoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc index 1982594c81..d52db1c481 100644 --- a/src/corelib/thread/qfuture.qdoc +++ b/src/corelib/thread/qfuture.qdoc @@ -123,15 +123,18 @@ To interact with running tasks using signals and slots, use QFutureWatcher. - You can also use QtFuture::connect to connect signals to a QFuture object + You can also use QtFuture::connect() to connect signals to a QFuture object which will be resolved when a signal is emitted. This allows working with signals like with QFuture objects. For example, if you combine it with then(), you can attach multiple continuations to a signal, which are invoked in the same thread or a new thread. + The QtFuture::whenAll() and QtFuture::whenAny() functions can be used to + combine several futures and track when the last or first of them completes. + A ready QFuture object with a value or a QFuture object holding exception can - be created using convenience functions QtFuture::makeReadyFuture and - QtFuture::makeExceptionalFuture. + be created using convenience functions QtFuture::makeReadyFuture() and + QtFuture::makeExceptionalFuture(). \note To start a computation and store results in a QFuture, use QPromise or one of the APIs in the \l {Qt Concurrent} framework. @@ -1367,7 +1370,7 @@ \snippet code/src_corelib_thread_qfuture.cpp 22 - \note The output sequence must support random access and support \c resize() + \note The output sequence must support random access and the \c resize() operation. If \c first equals \c last, this function returns a ready QFuture that -- cgit v1.2.3