Skip to content

Commit

Permalink
QMarginsF: document that isNull/operator==/operator!= are fuzzy
Browse files Browse the repository at this point in the history
Change-Id: Id1865f6d608e5cdbb6d24351aea5f6801a519684
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
(cherry picked from commit 4703e07)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
  • Loading branch information
dangelog authored and Qt Cherry-pick Bot committed Nov 2, 2020
1 parent 6e47076 commit 0a6aa1d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/corelib/tools/qmargins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,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.
*/
Expand Down Expand Up @@ -495,8 +495,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
*/


Expand Down Expand Up @@ -557,14 +559,26 @@ QDebug operator<<(QDebug dbg, const QMargins &m)
\fn bool operator==(const QMarginsF &lhs, const QMarginsF &rhs)
\relates QMarginsF
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 operator!=(const QMarginsF &lhs, const QMarginsF &rhs)
\relates QMarginsF
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
*/

/*!
Expand Down

0 comments on commit 0a6aa1d

Please sign in to comment.