summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpagelayout.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-04-04 23:59:37 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 22:06:55 +0200
commit4bed03eb8515d090f476ed69be6331bb513ffaf7 (patch)
tree5a96660611360c20de5878f135f467ee08965358 /src/gui/painting/qpagelayout.cpp
parent0de0f494bd75786ff361da2ac05c85d8aeac3b37 (diff)
QPageLayout: make op== non-member
Better style, since it treats the left-hand and right-hand size symmetrically, e.g. for implicit conversions. Change-Id: Ib5d39b1ebffffcb664ee2f72c756702469e32d3b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qpagelayout.cpp')
-rw-r--r--src/gui/painting/qpagelayout.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/painting/qpagelayout.cpp b/src/gui/painting/qpagelayout.cpp
index 5589a4364c..b48b9f6e4d 100644
--- a/src/gui/painting/qpagelayout.cpp
+++ b/src/gui/painting/qpagelayout.cpp
@@ -424,21 +424,23 @@ QPageLayout &QPageLayout::operator=(const QPageLayout &other)
*/
/*!
- Returns \c true if this page layout is equal to the \a other page layout,
+ \relates QPageLayout
+
+ Returns \c true if page layout \a lhs is equal to page layout \a rhs,
i.e. if all the attributes are exactly equal.
Note that this is a strict equality, especially for page size where the
QPageSize ID, name and size must exactly match, and the margins where the
units must match.
- \sa isEquivalentTo()
+ \sa QPageLayout::isEquivalentTo()
*/
-bool QPageLayout::operator==(const QPageLayout &other) const
+bool operator==(const QPageLayout &lhs, const QPageLayout &rhs)
{
- if (d && other.d)
- return (*d == *other.d);
- return (d == other.d);
+ if (lhs.d && rhs.d)
+ return (*lhs.d == *rhs.d);
+ return (lhs.d == rhs.d);
}
/*!