summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-10 13:11:39 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-08-10 13:55:26 (GMT)
commitd62491f595d59a63d9c493a223573e9af2306214 (patch)
tree4f2adf854344535e88a9bd3a65f27e41b7ad2af7
parent34dd8163f4fcd16be5677fc94ce960cc464991d5 (diff)
downloadQt-d62491f595d59a63d9c493a223573e9af2306214.zip
Qt-d62491f595d59a63d9c493a223573e9af2306214.tar.gz
Qt-d62491f595d59a63d9c493a223573e9af2306214.tar.bz2
add operator! to QScopedPointer
-rw-r--r--src/corelib/tools/qscopedpointer.cpp8
-rw-r--r--src/corelib/tools/qscopedpointer.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 06f9e6f..5b8991e 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -207,4 +207,12 @@ QT_BEGIN_NAMESPACE
Callers of this function take ownership of the pointer.
*/
+/*! \fn bool QScopedPointer::operator!() const
+
+ Returns \c true if the pointer referenced by this object is \c null, otherwise
+ returns \c false.
+
+ \sa isNull()
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 923ae1b..769ad10 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -123,6 +123,11 @@ public:
return d != other.d;
}
+ inline bool operator!() const
+ {
+ return !d;
+ }
+
#if defined(Q_CC_NOKIAX86) || defined(Q_QDOC)
inline operator bool() const
{