summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-02 14:17:04 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-02 14:43:32 +0100
commit4703e07a7c4ce9e89cadb0ef1c1ef69f8ed9fb21 (patch)
treea0eac5b047cf30ae35cffbeaa95dc1d546d03f60
parent1926e09b32fb6bd6ada6951c36cd337561964b79 (diff)
QMarginsF: document that isNull/operator==/operator!= are fuzzy
Change-Id: Id1865f6d608e5cdbb6d24351aea5f6801a519684 Pick-to: 5.15 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/corelib/tools/qmargins.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp
index 62ccfff792..5b3c04d11e 100644
--- a/src/corelib/tools/qmargins.cpp
+++ b/src/corelib/tools/qmargins.cpp
@@ -470,7 +470,7 @@ QDebug operator<<(QDebug dbg, const QMargins &m)
QMarginsF defines a set of four margins; left, top, right and bottom,
that describe the size of the borders surrounding a rectangle.
- The isNull() function returns \c true only if all margins are set to zero.
+ The isNull() function returns \c true only if all margins are very close to zero.
QMarginsF objects can be streamed as well as compared.
*/
@@ -505,8 +505,10 @@ QDebug operator<<(QDebug dbg, const QMargins &m)
/*!
\fn bool QMarginsF::isNull() const
- Returns \c true if all margins are 0; otherwise returns
+ Returns \c true if all margins are very close to 0; otherwise returns
false.
+
+ \sa qFuzzyIsNull
*/
@@ -566,13 +568,25 @@ QDebug operator<<(QDebug dbg, const QMargins &m)
/*!
\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.
+ Returns \c true if \a lhs and \a rhs are approximately equal; otherwise
+ returns false.
+
+ \warning This function does not check for strict equality; instead,
+ it uses a fuzzy comparison to compare the margins.
+
+ \sa qFuzzyCompare
*/
/*!
\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.
+ Returns \c true if \a lhs and \a rhs are sufficiently different; otherwise
+ returns \c false.
+
+ \warning This function does not check for strict inequality; instead,
+ it uses a fuzzy comparison to compare the margins.
+
+ \sa qFuzzyCompare
*/
/*!