Skip to content

Commit a7d8d3e

Browse files
committed
Clarify QFuture::isValid() docs
It was not clear that the function will return true even when the result is not yet ready, so mention it explicitly. Amends 44ceb56. Fixes: QTBUG-136530 Pick-to: 6.9 6.8 6.5 Change-Id: I03b79f2b28c4bb755e6f56147cc7af1413ed4e57 Reviewed-by: Edward Welbourne <[email protected]>
1 parent 8391685 commit a7d8d3e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/corelib/thread/qfuture.qdoc

+8-2
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,15 @@
519519
\since 6.0
520520

521521
Returns \c true if a result or results can be accessed or taken from this
522-
QFuture object. Returns false after the result was taken from the future.
522+
QFuture object. Returns \c false after the result was taken from the future.
523523

524-
\sa takeResult(), result(), results(), resultAt()
524+
\note The return value of this function only implies whether the future
525+
result can be consumed, not if it is ready. This function will return
526+
\c true when the related QPromise is started, but the result is not yet
527+
ready. To test readiness, call \l isResultReadyAt() or \l isFinished().
528+
529+
\sa takeResult(), result(), results(), resultAt(), isFinished(),
530+
isResultReadyAt()
525531
*/
526532

527533
/*! \fn template<typename T> template<class U = T, typename = QtPrivate::EnableForNonVoid<U>> QFuture<T>::const_iterator QFuture<T>::begin() const

0 commit comments

Comments
 (0)