From feda3e7673137c3f6a9f3561276b6d21447fd881 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 26 Oct 2020 16:34:20 +0100 Subject: 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 --- src/corelib/tools/qrect.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/corelib/tools/qrect.cpp') diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp index 326b0c0cd8..d38e532efe 100644 --- a/src/corelib/tools/qrect.cpp +++ b/src/corelib/tools/qrect.cpp @@ -1141,8 +1141,7 @@ bool QRect::intersects(const QRect &r) const noexcept } /*! - \fn bool operator==(const QRect &r1, const QRect &r2) - \relates QRect + \fn bool QRect::operator==(const QRect &r1, const QRect &r2) Returns \c true if the rectangles \a r1 and \a r2 are equal, otherwise returns \c false. @@ -1150,8 +1149,7 @@ bool QRect::intersects(const QRect &r) const noexcept /*! - \fn bool operator!=(const QRect &r1, const QRect &r2) - \relates QRect + \fn bool QRect::operator!=(const QRect &r1, const QRect &r2) Returns \c true if the rectangles \a r1 and \a r2 are different, otherwise returns \c false. @@ -2368,8 +2366,7 @@ QRect QRectF::toAlignedRect() const noexcept */ /*! - \fn bool operator==(const QRectF &r1, const QRectF &r2) - \relates QRectF + \fn bool QRectF::operator==(const QRectF &r1, const QRectF &r2) Returns \c true if the rectangles \a r1 and \a r2 are \b approximately equal, otherwise returns \c false. @@ -2382,8 +2379,7 @@ QRect QRectF::toAlignedRect() const noexcept /*! - \fn bool operator!=(const QRectF &r1, const QRectF &r2) - \relates QRectF + \fn bool QRectF::operator!=(const QRectF &r1, const QRectF &r2) Returns \c true if the rectangles \a r1 and \a r2 are sufficiently different, otherwise returns \c false. -- cgit v1.2.3