From 199e1a10918732f1928e2a654a33c50200e7fcdb Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Wed, 8 May 2024 18:20:36 +0200 Subject: 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 --- src/corelib/kernel/qelapsedtimer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qelapsedtimer.cpp') 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. -- cgit v1.2.3