QPointer: add get()

[ChangeLog][QtCore][QPointer] Added get() for STL
compatibility.

Change-Id: I84bf9d58cd92e1bc74f731c3e9002031045f8f5c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Giuseppe D'Angelo 2020-06-08 18:51:19 +02:00
parent c55f45e875
commit 85c1009dbb
2 changed files with 9 additions and 0 deletions

View File

@ -155,6 +155,13 @@
Returns the pointer to the object being guarded.
*/
/*!
\fn template <class T> T* QPointer<T>::get() const
\since 6.0
Same as data(). This function is provided for STL compatibility.
*/
/*!
\fn template <class T> bool QPointer<T>::isNull() const

View File

@ -75,6 +75,8 @@ public:
inline T* data() const
{ return static_cast<T*>(wp.internalData()); }
inline T* get() const
{ return data(); }
inline T* operator->() const
{ return data(); }
inline T& operator*() const