![]() |
CopperSpice API
1.8.1
|
Contains a pointer to a QObject. More...
Public Methods | |
QPointer () | |
QPointer (const QPointer &other) = default | |
QPointer (QPointer &&other) = default | |
QPointer (T *ptr) | |
~QPointer () = default | |
void | clear () |
T * | data () const |
bool | isNull () const |
operator T * () const | |
T & | operator* () const |
T * | operator-> () const |
QPointer & | operator= (const QPointer &other) = default |
QPointer & | operator= (QPointer &&other) = default |
QPointer< T > & | operator= (T *ptr) |
Related Functions | |
These are not member functions | |
bool | operator!= (const QPointer< T > &ptr1, const QPointer< T > &ptr2) |
bool | operator!= (const QPointer< T > &ptr1, const T *ptr2) |
bool | operator!= (const QPointer< T > &ptr1, T *ptr2) |
bool | operator!= (const T *ptr1, const QPointer< T > &ptr2) |
bool | operator!= (T *ptr1, const QPointer< T > &ptr2) |
bool | operator== (const QPointer< T > &ptr1, const QPointer< T > &ptr2) |
bool | operator== (const QPointer< T > &ptr1, const T *ptr2) |
bool | operator== (const QPointer< T > &ptr1, T *ptr2) |
bool | operator== (const T *ptr1, const QPointer< T > &a ptr2) |
bool | operator== (T *ptr1, const QPointer< T > &ptr2) |
The QPointer class contains a pointer which can only point to a QObject or a child of QObject. The internal pointer is very similar to a weak pointer. However, there is no reference count in a QPointer, it is maintained in the QObject class. When a QObject or a class which inherits from QObject is deleted this class will contain a nullptr.
QPointer can never be used in a thread safe manner and should only be used in single threaded applications. From multi-threaded applications use a QSharedPointer with a QWeakPointer.
|
inline |
Constructs QPointer which contains a null pointer.
|
inline |
Constructs a QPointer which points to the same object which ptr points to. The template parameter T must inherit from QObject.
|
default |
Destroys the pointer.
|
default |
Copy constructs a new QPointer from other.
|
default |
Move constructs a new QPointer from other.
|
inline |
Sets the current QPointer object to a null pointer.
|
inline |
Returns a raw pointer to the current object. The template parameter T must inherit from QObject.
|
inline |
Returns true if the referenced object has been destroyed or if there is no referenced object, otherwise returns false.
|
inline |
This method converts a QPointer to a raw pointer.
|
inline |
Dereferences this QPointer and returns the object it points to. If the QPointer is a nullptr the behavior is undefined.
|
inline |
Dereferences this QPointer and returns a raw pointer to the object it points to. If the QPointer is a nullptr the behavior is undefined.
|
default |
Copy assigns from other and returns a reference to this object.
|
default |
Move assigns from other and returns a reference to this object.
|
inline |
Assigns ptr to this QPointer.
|
related |
Returns true if ptr1 and ptr2 do not point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 do not point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 do not point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 do not point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 do not point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 point to the same object, otherwise returns false.
|
related |
Returns true if ptr1 and ptr2 point to the same object, otherwise returns false.