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 @@ -728,6 +728,17 @@ QRegion QRegion::intersect(const QRect &r) const \snippet doc/src/snippets/code/src_gui_painting_qregion_unix.cpp 0 */ +/*! + \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 @@ -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;