diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-11-22 11:01:43 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-11-26 22:40:54 +0100 |
commit | 086a08dcf9f2f1b6745a0a01a0f54668a0bb7dd8 (patch) | |
tree | 3007d0aa61fdbc7201d4966229e6a21ed0db30f9 /src | |
parent | fd1a42490dc14e5cf4fbbd2682722305ce7a27ed (diff) |
Mention QtFuture::when* functions in QFuture's docs
Also fix an unrelated minor issue in QtFuture::whenAll docs.
Task-number: QTBUG-86714
Change-Id: I45f06b17db0508be10215e6d260ef76ede3077fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/thread/qfuture.qdoc | 11 |
1 files changed, 7 insertions, 4 deletions
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 |