diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 3651aaa9d79..6b260a36ecb 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2236,38 +2236,38 @@ int QTime::msecsTo(QTime t) const /*! - \fn bool QTime::operator==(QTime lhs, QTime rhs) + \fn bool QTime::operator==(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is equal to \a rhs; otherwise returns \c false. */ /*! - \fn bool QTime::operator!=(QTime lhs, QTime rhs) + \fn bool QTime::operator!=(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is different from \a rhs; otherwise returns \c false. */ /*! - \fn bool QTime::operator<(QTime lhs, QTime rhs) + \fn bool QTime::operator<(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is earlier than \a rhs; otherwise returns \c false. */ /*! - \fn bool QTime::operator<=(QTime lhs, QTime rhs) + \fn bool QTime::operator<=(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is earlier than or equal to \a rhs; otherwise returns \c false. */ /*! - \fn bool QTime::operator>(QTime lhs, QTime rhs) + \fn bool QTime::operator>(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is later than \a rhs; otherwise returns \c false. */ /*! - \fn bool QTime::operator>=(QTime lhs, QTime rhs) + \fn bool QTime::operator>=(const QTime &lhs, const QTime &rhs) Returns \c true if \a lhs is later than or equal to \a rhs; otherwise returns \c false. diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index 6183daa5a1d..0301a4fdded 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -235,12 +235,12 @@ private: constexpr inline int ds() const { return mds == -1 ? 0 : mds; } int mds; - friend constexpr bool operator==(QTime lhs, QTime rhs) { return lhs.mds == rhs.mds; } - friend constexpr bool operator!=(QTime lhs, QTime rhs) { return lhs.mds != rhs.mds; } - friend constexpr bool operator< (QTime lhs, QTime rhs) { return lhs.mds < rhs.mds; } - friend constexpr bool operator<=(QTime lhs, QTime rhs) { return lhs.mds <= rhs.mds; } - friend constexpr bool operator> (QTime lhs, QTime rhs) { return lhs.mds > rhs.mds; } - friend constexpr bool operator>=(QTime lhs, QTime rhs) { return lhs.mds >= rhs.mds; } + friend constexpr bool comparesEqual(const QTime &lhs, const QTime &rhs) noexcept + { return lhs.mds == rhs.mds; } + friend constexpr Qt::strong_ordering + compareThreeWay(const QTime &lhs, const QTime &rhs) noexcept + { return Qt::compareThreeWay(lhs.mds, rhs.mds); } + Q_DECLARE_STRONGLY_ORDERED_LITERAL_TYPE(QTime) friend class QDateTime; friend class QDateTimePrivate;