summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmargins.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2024-04-19 18:06:27 +0200
committerIvan Solovev <ivan.solovev@qt.io>2024-05-10 15:33:40 +0200
commiteb178d3e51019747bcf9446eef62358e9b9072d2 (patch)
treed81c190e8f84d2a8a6ab8475b5325ebf875534de /src/corelib/tools/qmargins.cpp
parent8a54d25a4672b69a7d7ebcf7573d850df7177586 (diff)
QMargins(F): use comparison helper macros
Also explicitly add QMarginsF vs QMargins comparison. Previously such comparison was implicitly converting QMargins to QMarginsF, and doing the fuzzy comparison. We have to keep the old behavior to avoid breaking user code, so use fuzzy comparison in the new operators as well. Task-number: QTBUG-120308 Change-Id: Ic82f64078cd991859b851f24aa7017ef0b91a4e1 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Diffstat (limited to 'src/corelib/tools/qmargins.cpp')
-rw-r--r--src/corelib/tools/qmargins.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp
index 1d2cb7d6e5..fbb431e7a4 100644
--- a/src/corelib/tools/qmargins.cpp
+++ b/src/corelib/tools/qmargins.cpp
@@ -14,6 +14,10 @@ QT_BEGIN_NAMESPACE
\ingroup painting
\since 4.6
+ \compares equality
+ \compareswith equality QMarginsF
+ \endcompareswith
+
\brief The QMargins class defines the four margins of a rectangle.
QMargin defines a set of four margins; left, top, right, and bottom,
@@ -107,15 +111,15 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QMargins::operator==(const QMargins &m1, const QMargins &m2)
+ \fn bool QMargins::operator==(const QMargins &lhs, const QMargins &rhs)
- Returns \c true if \a m1 and \a m2 are equal; otherwise returns \c false.
+ Returns \c true if \a lhs and \a rhs are equal; otherwise returns \c false.
*/
/*!
- \fn bool QMargins::operator!=(const QMargins &m1, const QMargins &m2)
+ \fn bool QMargins::operator!=(const QMargins &lhs, const QMargins &rhs)
- Returns \c true if \a m1 and \a m2 are different; otherwise returns \c false.
+ Returns \c true if \a lhs and \a rhs are different; otherwise returns \c false.
*/
/*!
@@ -438,6 +442,10 @@ QDebug operator<<(QDebug dbg, const QMargins &m)
\ingroup painting
\since 5.3
+ \compares equality
+ \compareswith equality QMargins
+ \endcompareswith
+
\brief The QMarginsF class defines the four margins of a rectangle.
QMarginsF defines a set of four margins; left, top, right, and bottom,