diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index bce4c64..90ca34f 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -555,10 +555,12 @@ public: inline QWeakPointer() : d(0), value(0) { } inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; } +#ifndef QT_NO_QOBJECT // special constructor that is enabled only if X derives from QObject template <class X> inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr) { } +#endif template <class X> inline QWeakPointer &operator=(X *ptr) { return *this = QWeakPointer(ptr); } |