From 0b9aa12659d5ea6b15fe72f963cc98db9af585fc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 3 Nov 2010 16:39:25 +0100 Subject: Document the difference between +0.0 and -0.0 for QPointF and QSizeF. Reviewed-by: Robert Griebl --- src/corelib/tools/qpoint.cpp | 6 +++++- src/corelib/tools/qsize.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index 66f06e9..c297709 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -438,8 +438,12 @@ QDebug operator<<(QDebug d, const QPointF &p) /*! \fn bool QPointF::isNull() const - Returns true if both the x and y coordinates are set to 0.0, + Returns true if both the x and y coordinates are set to +0.0; otherwise returns false. + + \note Since this function treats +0.0 and -0.0 differently, points + with zero-valued coordinates where either or both values have a + negative sign are not defined to be null points. */ diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp index 20ac344..12287ab 100644 --- a/src/corelib/tools/qsize.cpp +++ b/src/corelib/tools/qsize.cpp @@ -492,9 +492,13 @@ QDebug operator<<(QDebug dbg, const QSize &s) { /*! \fn bool QSizeF::isNull() const - Returns true if both the width and height is 0; otherwise returns + Returns true if both the width and height are +0.0; otherwise returns false. + \note Since this function treats +0.0 and -0.0 differently, sizes with + zero width and height where either or both values have a negative + sign are not defined to be null sizes. + \sa isValid(), isEmpty() */ -- cgit v0.12