diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-06-02 19:02:42 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2009-06-15 11:00:00 (GMT) |
commit | b615be69f06a97aff3694065e97541133647d877 (patch) | |
tree | dc90aa08d31b6bdde2d534394311d3543a9e9981 /src/gui/painting/qmatrix.cpp | |
parent | 44766d265c16551043d2739171069fe042c40091 (diff) | |
download | Qt-b615be69f06a97aff3694065e97541133647d877.zip Qt-b615be69f06a97aff3694065e97541133647d877.tar.gz Qt-b615be69f06a97aff3694065e97541133647d877.tar.bz2 |
implement equality operator in a more sane way
Using qFuzzyCompare for checking whether two transformations
are equal doesn't give us too much and is inconsistent with
our other matrix classes. Using simple floating point
equality is a lot faster as well.
Added qFuzzyCompare overloads for QMatrix and QTransform to still
allow for fuzzy comparisons.
Reviewed-By: Samuel Rødal
Diffstat (limited to 'src/gui/painting/qmatrix.cpp')
-rw-r--r-- | src/gui/painting/qmatrix.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 030415d..7e26a99 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -1194,4 +1194,15 @@ QDebug operator<<(QDebug dbg, const QMatrix &m) Use the mapRect() function instead. */ + +/*! + \fn bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2) + + \relates QMatrix + \since 4.6 + + Returns true if \a m1 and \a m2 are equal, allowing for a small + fuzziness factor for floating-point comparisons; false otherwise. +*/ + QT_END_NAMESPACE |