diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-28 00:02:59 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-28 22:14:56 +0100 |
commit | a45a3b1ece490bcae5cccd858dbe11408a19bee0 (patch) | |
tree | 4bfee963625fab42fc7b9d14608916cb38678994 /src/gui/painting/qpagelayout.cpp | |
parent | 979c8cf1b75e3e0e0dcf7c718c3fed6fdfdd7ea3 (diff) |
Make comparison operators in gui/painting classes hidden friends
Reduce ADL noise from QColorSpace, QPageSize, and QPageLayout with the
help of a private equals method.
Change-Id: I0082597dd216b982e8d8eb5a4bd7dd29a5d3263b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/painting/qpagelayout.cpp')
-rw-r--r-- | src/gui/painting/qpagelayout.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/painting/qpagelayout.cpp b/src/gui/painting/qpagelayout.cpp index 2634a448a5..def9751aa6 100644 --- a/src/gui/painting/qpagelayout.cpp +++ b/src/gui/painting/qpagelayout.cpp @@ -415,7 +415,7 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other) */ /*! - \relates QPageLayout + \fn bool QPageLayout::operator==(const QPageLayout &lhs, const QPageLayout &rhs) Returns \c true if page layout \a lhs is equal to page layout \a rhs, i.e. if all the attributes are exactly equal. @@ -427,14 +427,8 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other) \sa QPageLayout::isEquivalentTo() */ -bool operator==(const QPageLayout &lhs, const QPageLayout &rhs) -{ - return lhs.d == rhs.d || *lhs.d == *rhs.d; -} - /*! - \fn bool operator!=(const QPageLayout &lhs, const QPageLayout &rhs) - \relates QPageLayout + \fn bool QPageLayout::operator!=(const QPageLayout &lhs, const QPageLayout &rhs) Returns \c true if page layout \a lhs is not equal to page layout \a rhs, i.e. if any of the attributes differ. @@ -447,6 +441,15 @@ bool operator==(const QPageLayout &lhs, const QPageLayout &rhs) */ /*! + \internal +*/ +bool QPageLayout::equals(const QPageLayout &other) const +{ + return d == other.d || *d == *other.d; +} + + +/*! Returns \c true if this page layout is equivalent to the \a other page layout, i.e. if the page has the same size, margins and orientation. */ |