QPointer, QSharedPointer and QWeakPointer - When it's perfect solution when it's not?
Solved
General and Desktop
-
Hello!
Just got curious about situation when using of QPointer, QSharedPointer or QWeakPointer is perfect solution and when it's not. Suggestions? -
QPointer
when you want to observe QObject's lifetime.
QSharedPointer
when you share ownership of an object (last owner deletes the object)
QWeakPointer
when you want to observe lifetime of an object owned by shared pointers. -
QPointer
when you want to observe QObject's lifetime.
QSharedPointer
when you share ownership of an object (last owner deletes the object)
QWeakPointer
when you want to observe lifetime of an object owned by shared pointers.@Chris-Kawa Thx. Looks very similar to Objective-C pointers ... Issue closed.