summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qpromise.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qpromise.qdoc')
-rw-r--r--src/corelib/thread/qpromise.qdoc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/corelib/thread/qpromise.qdoc b/src/corelib/thread/qpromise.qdoc
index 4b7b497b3f..279bc8766a 100644
--- a/src/corelib/thread/qpromise.qdoc
+++ b/src/corelib/thread/qpromise.qdoc
@@ -107,13 +107,17 @@
Returns a future associated with this promise.
*/
-/*! \fn template <typename T> void QPromise<T>::addResult(const T &result, int index = -1)
+/*! \fn template <typename T> bool QPromise<T>::addResult(const T &result, int index = -1)
+ \fn template <typename T> bool QPromise<T>::addResult(T &&result, int index = -1)
Adds \a result to the internal result collection at \a index position. If
index is unspecified, \a result is added to the end of the collection.
- \note addResult() rejects \a result if there's already another result in the
- collection stored at the same index.
+ Returns \c true when \a result is added to the collection.
+
+ Returns \c false when this promise is in cancelled or finished state or when
+ \a result is rejected. addResult() rejects \a result if there's already
+ another result in the collection stored at the same index.
You can get a result at a specific index by calling QFuture::resultAt().
@@ -124,11 +128,6 @@
thinking if there are index gaps or not, use QFuture::results().
*/
-/*! \fn template <typename T> void QPromise<T>::addResult(T &&result, int index = -1)
-
- \overload
-*/
-
/*! \fn template<typename T> void QPromise<T>::setException(const QException &e)
Sets exception \a e to be the result of the computation.