diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-10-25 14:52:21 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-08 06:20:42 +0100 |
commit | 04f6983979021aecd5c3dbb7cc80f864bb4ee56d (patch) | |
tree | cf132a92af2cd09da8fb090f76400541e62bed2c /src/gui | |
parent | d7208aa0c63bf4492776335d4d6fce8ffb9327de (diff) |
Implement QRegion::isNull
The method was missing from QVariant perspective (QVariant::isNull
supposed to call isNull not isEmpty).
Change-Id: Ic1ac9f662e275ac73908809f2c4ac59679b40b00
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qregion.cpp | 15 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 2843e5ccb7..66b12e5034 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -729,6 +729,17 @@ QRegion QRegion::intersect(const QRect &r) const */ /*! + \fn bool QRegion::isNull() const + \since 5.0 + + Returns true if the region is empty; otherwise returns false. An + empty region is a region that contains no points. This function is + the same as isEmpty + + \sa isEmpty() +*/ + +/*! \fn bool QRegion::contains(const QPoint &p) const Returns true if the region contains the point \a p; otherwise @@ -3893,6 +3904,10 @@ bool QRegion::isEmpty() const return d == &shared_empty || d->qt_rgn->numRects == 0; } +bool QRegion::isNull() const +{ + return d == &shared_empty || d->qt_rgn->numRects == 0; +} bool QRegion::contains(const QPoint &p) const { diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index a599b3ad16..a5ea88b8bd 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -82,6 +82,7 @@ public: #endif inline void swap(QRegion &other) { qSwap(d, other.d); } bool isEmpty() const; + bool isNull() const; bool contains(const QPoint &p) const; bool contains(const QRect &r) const; |