Clarify QElapsedTimer::hasExpired()'s documentation

The description in terms of timeouts was confusing. Instead, say what
it actually does, in plain terms. Mention that you can do similar for
a duration.

Task-number: QTBUG-115447
Change-Id: I4618d7fa290e7959ed3cb51e5c2576b041f77091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 669470e2be99dbeef2ec1b2083cf6a86c8c9d917)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Edward Welbourne 2023-07-24 10:16:59 +02:00 committed by Qt Cherry-pick Bot
parent ff157648d6
commit 392131feb4

View File

@ -403,10 +403,12 @@ bool QElapsedTimer::isValid() const noexcept
} }
/*! /*!
Returns \c true if this QElapsedTimer has already expired by \a timeout Returns \c true if elapsed() exceeds the given \a timeout, otherwise \c false.
milliseconds (that is, more than \a timeout milliseconds have elapsed).
The value of \a timeout can be -1 to indicate that this timer does not A negative \a timeout is interpreted as infinite, so \c false is returned in
expire, in which case this function will always return false. this case. Otherwise, this is equivalent to \c {elapsed() > timeout}. You
can do the same for a duration by comparing durationElapsed() to a duration
timeout.
\sa elapsed(), QDeadlineTimer \sa elapsed(), QDeadlineTimer
*/ */