diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-24 10:16:59 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-25 12:31:04 +0200 |
| commit | 669470e2be99dbeef2ec1b2083cf6a86c8c9d917 (patch) | |
| tree | f64204a4bb6835fe94c8f809f78d61e95bf45a8a /src/corelib/kernel/qelapsedtimer.cpp | |
| parent | 93e9d214904b73d4d89ea4f2c1b836d768cf7284 (diff) | |
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.
Pick-to: 6.6
Task-number: QTBUG-115447
Change-Id: I4618d7fa290e7959ed3cb51e5c2576b041f77091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qelapsedtimer.cpp')
| -rw-r--r-- | src/corelib/kernel/qelapsedtimer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp index 66ae82811f7..b0a5c07179b 100644 --- a/src/corelib/kernel/qelapsedtimer.cpp +++ b/src/corelib/kernel/qelapsedtimer.cpp @@ -403,10 +403,12 @@ bool QElapsedTimer::isValid() const noexcept } /*! - Returns \c true if this QElapsedTimer has already expired by \a timeout - 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 - expire, in which case this function will always return false. + Returns \c true if elapsed() exceeds the given \a timeout, otherwise \c false. + + A negative \a timeout is interpreted as infinite, so \c false is returned in + 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 */ |
