Implement QRegion::isNull
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Tue, 25 Oct 2011 12:52:21 +0000 (14:52 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 8 Nov 2011 05:20:42 +0000 (06:20 +0100)
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>
src/gui/painting/qregion.cpp
src/gui/painting/qregion.h

index 2843e5c..66b12e5 100644 (file)
@@ -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
 {
index a599b3a..a5ea88b 100644 (file)
@@ -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;