diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-26 16:34:20 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-26 20:10:49 +0100 |
commit | feda3e7673137c3f6a9f3561276b6d21447fd881 (patch) | |
tree | 43724a514793a2a91926182a6b8776ffa2e3cbbf /src/corelib/tools/qmargins.cpp | |
parent | 525372c56771a548ac2842ee860730c6ad1e5577 (diff) |
Make QRect(F) and QMargins comparison operators hidden friends
Hide them from ADL to reduce noise. QRect operators were already
implemented as hidden friends, but a left-over declaration un-hid them
again.
Use the opportunity to simplify QMargins::operator!= by just inverting
operator==. No need to spell things out, the compiler can do that for us.
Change-Id: I55722223a2267cbeba5726dc912b48d6e017e580
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/corelib/tools/qmargins.cpp')
-rw-r--r-- | src/corelib/tools/qmargins.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp index a238032f65..62ccfff792 100644 --- a/src/corelib/tools/qmargins.cpp +++ b/src/corelib/tools/qmargins.cpp @@ -143,15 +143,13 @@ QT_BEGIN_NAMESPACE */ /*! - \fn bool operator==(const QMargins &m1, const QMargins &m2) - \relates QMargins + \fn bool QMargins::operator==(const QMargins &m1, const QMargins &m2) Returns \c true if \a m1 and \a m2 are equal; otherwise returns \c false. */ /*! - \fn bool operator!=(const QMargins &m1, const QMargins &m2) - \relates QMargins + \fn bool QMargins::operator!=(const QMargins &m1, const QMargins &m2) Returns \c true if \a m1 and \a m2 are different; otherwise returns \c false. */ @@ -566,15 +564,13 @@ QDebug operator<<(QDebug dbg, const QMargins &m) */ /*! - \fn bool operator==(const QMarginsF &lhs, const QMarginsF &rhs) - \relates QMarginsF + \fn bool QMarginsF::operator==(const QMarginsF &lhs, const QMarginsF &rhs) Returns \c true if \a lhs and \a rhs are equal; otherwise returns \c false. */ /*! - \fn bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs) - \relates QMarginsF + \fn bool QMarginsF::operator!=(const QMarginsF &lhs, const QMarginsF &rhs) Returns \c true if \a lhs and \a rhs are different; otherwise returns \c false. */ |