summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qelapsedtimer.cpp
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2024-05-08 18:20:36 +0200
committerTatiana Borisova <tatiana.borisova@qt.io>2024-05-14 00:32:34 +0200
commit199e1a10918732f1928e2a654a33c50200e7fcdb (patch)
treee4ef2a949b31e6c3870f9dbb2406365871a7830e /src/corelib/kernel/qelapsedtimer.cpp
parent4585cacaa9f9329a10aaf13a449151f5e9bc7a2c (diff)
QElapsedTimer: use new comparison helper macros
Replace public friend operators operator==(), operator!=(), of QElapsedTimer to the friend method comparesEqual(). Add compareThreeWay() for the <=> operator. Save friend bool Q_CORE_EXPORT operator<() method and add defined(__cpp_lib_three_way_comparison) condition for the C++20 spaceship operator. Task-number: QTBUG-120304 Change-Id: I575865403f4e333578ff174e8e6879e8925d4b09 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/kernel/qelapsedtimer.cpp')
-rw-r--r--src/corelib/kernel/qelapsedtimer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp
index 511b81a04e2..c4308a0b8f7 100644
--- a/src/corelib/kernel/qelapsedtimer.cpp
+++ b/src/corelib/kernel/qelapsedtimer.cpp
@@ -14,6 +14,8 @@ QT_BEGIN_NAMESPACE
\reentrant
\ingroup tools
+ \compares strong
+
The QElapsedTimer class is usually used to quickly calculate how much
time has elapsed between two events. Its API is similar to that of QTime,
so code that was using that can be ported quickly to the new class.
@@ -155,8 +157,7 @@ QT_BEGIN_NAMESPACE
Returns \c true if \a lhs and \a rhs contain different times, false otherwise.
*/
/*!
- \fn bool operator<(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
- \relates QElapsedTimer
+ \fn bool QElapsedTimer::operator<(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
Returns \c true if \a lhs was started before \a rhs, false otherwise.