From a7d8d3ecdd934b4fcce6fd2658f0ac6a38a7dde1 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Tue, 6 May 2025 14:05:57 +0200 Subject: [PATCH] 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 44ceb56455c82df3e6b1c9a2fa373cac14a039f8. Fixes: QTBUG-136530 Pick-to: 6.9 6.8 6.5 Change-Id: I03b79f2b28c4bb755e6f56147cc7af1413ed4e57 Reviewed-by: Edward Welbourne --- src/corelib/thread/qfuture.qdoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc index 508177fc364..c4d4daae99f 100644 --- a/src/corelib/thread/qfuture.qdoc +++ b/src/corelib/thread/qfuture.qdoc @@ -519,9 +519,15 @@ \since 6.0 Returns \c true if a result or results can be accessed or taken from this - QFuture object. Returns false after the result was taken from the future. + QFuture object. Returns \c false after the result was taken from the future. - \sa takeResult(), result(), results(), resultAt() + \note The return value of this function only implies whether the future + result can be consumed, not if it is ready. This function will return + \c true when the related QPromise is started, but the result is not yet + ready. To test readiness, call \l isResultReadyAt() or \l isFinished(). + + \sa takeResult(), result(), results(), resultAt(), isFinished(), + isResultReadyAt() */ /*! \fn template template> QFuture::const_iterator QFuture::begin() const