|
QGIS API Documentation 3.99.0-Master (c22de0620c0)
|
Keeps a pointer to a QObject and deletes it whenever this object is deleted. More...
#include <qobjectuniqueptr.h>
Public Member Functions | |
| QObjectUniquePtr () | |
| Creates a new empty QObjectUniquePtr. | |
| QObjectUniquePtr (const QObjectUniquePtr &other)=delete | |
| QObjectUniquePtr (QObjectUniquePtr &&other) | |
| QObjectUniquePtr (T *p) | |
| Takes a new QObjectUniquePtr and assigned p to it. | |
| ~QObjectUniquePtr () | |
| Will delete the contained QObject if it still exists. | |
| void | clear () |
| Clears the pointer. | |
| T * | data () const |
| Returns the raw pointer to the managed QObject. | |
| T * | get () const |
| Returns the raw pointer to the managed QObject. | |
| bool | isNull () const |
| Checks if the managed pointer is nullptr. | |
| operator bool () const | |
| Checks if the pointer managed by this object is nullptr. | |
| operator T* () const | |
| Const getter for the managed raw pointer. | |
| T & | operator* () const |
| Dereferences the managed QObject. | |
| T * | operator-> () const |
| Returns a raw pointer to the managed QObject. | |
| QObjectUniquePtr & | operator= (const QObjectUniquePtr &other)=delete |
| QObjectUniquePtr & | operator= (QObjectUniquePtr &&other) noexcept |
| QObjectUniquePtr< T > & | operator= (T *p) |
| T * | release () |
| Clears the pointer and returns it. | |
| void | reset (T *p=nullptr) |
| Will reset the managed pointer to p. | |
| void | swap (QObjectUniquePtr &other) |
| Swaps the pointer managed by this instance with the pointer managed by other. | |
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
It keeps a weak pointer to the QObject internally and will be set to nullptr whenever the QObject is deleted.
Definition at line 45 of file qobjectuniqueptr.h.
|
inline |
Creates a new empty QObjectUniquePtr.
Definition at line 66 of file qobjectuniqueptr.h.
|
inline |
Takes a new QObjectUniquePtr and assigned p to it.
Definition at line 72 of file qobjectuniqueptr.h.
|
inline |
Will delete the contained QObject if it still exists.
Definition at line 78 of file qobjectuniqueptr.h.
|
delete |
|
inline |
Definition at line 88 of file qobjectuniqueptr.h.
|
inline |
Clears the pointer.
The managed object is set to nullptr and will not be deleted.
Definition at line 179 of file qobjectuniqueptr.h.
|
inline |
Returns the raw pointer to the managed QObject.
Definition at line 121 of file qobjectuniqueptr.h.
|
inline |
Returns the raw pointer to the managed QObject.
Definition at line 129 of file qobjectuniqueptr.h.
|
inline |
Checks if the managed pointer is nullptr.
Definition at line 161 of file qobjectuniqueptr.h.
|
inlineexplicit |
Checks if the pointer managed by this object is nullptr.
If it is not nullptr true will be returned, if it is nullptr false will be returned.
Definition at line 171 of file qobjectuniqueptr.h.
|
inline |
Const getter for the managed raw pointer.
Definition at line 153 of file qobjectuniqueptr.h.
|
inline |
Dereferences the managed QObject.
Definition at line 145 of file qobjectuniqueptr.h.
|
inline |
Returns a raw pointer to the managed QObject.
Definition at line 137 of file qobjectuniqueptr.h.
|
delete |
|
inlinenoexcept |
Definition at line 93 of file qobjectuniqueptr.h.
|
inline |
Definition at line 112 of file qobjectuniqueptr.h.
|
inline |
Clears the pointer and returns it.
The managed object will not be deleted and it is the callers responsibility to guarantee that no memory is leaked.
Definition at line 188 of file qobjectuniqueptr.h.
|
inline |
Will reset the managed pointer to p.
If there is already a QObject managed currently it will be deleted. If p is not specified the managed QObject will be deleted and this object reset to nullptr.
Definition at line 200 of file qobjectuniqueptr.h.
|
inline |
Swaps the pointer managed by this instance with the pointer managed by other.
Definition at line 107 of file qobjectuniqueptr.h.