Add clear() to QPointer for QWeakPointer compatibility.
Change-Id: I9efc162bf56775c7ebcff4e3b79a997edc4ceaeb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
28dd6eda7b
commit
55d0c6c6cf
|
|
@ -170,6 +170,14 @@
|
|||
there is no referenced object; otherwise returns false.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QPointer::clear()
|
||||
|
||||
Clears this QPointer object.
|
||||
|
||||
\sa isNull()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T* QPointer::operator->() const
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ protected:
|
|||
|
||||
inline bool isNull() const
|
||||
{ return wp.isNull(); }
|
||||
|
||||
inline void clear()
|
||||
{ wp.clear(); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
|
@ -93,8 +96,10 @@ public:
|
|||
{ return data(); }
|
||||
#ifdef qdoc
|
||||
inline bool isNull() const;
|
||||
inline void clear() const;
|
||||
#else
|
||||
using QPointerBase::isNull;
|
||||
using QPointerBase::clear;
|
||||
#endif
|
||||
};
|
||||
template <class T> Q_DECLARE_TYPEINFO_BODY(QPointer<T>, Q_MOVABLE_TYPE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue