diff options
-rw-r--r-- | src/corelib/tools/qscopedpointer.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qscopedpointer.h | 5 |
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 { |