Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Smart Pointers: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Cleanup)
(adds context on the existence of QPointer)
 
Line 7: Line 7:
== Smart Pointers in Qt ==
== Smart Pointers in Qt ==


* {{DocLink|QPointer}}
* {{DocLink|QSharedDataPointer}}
* {{DocLink|QSharedDataPointer}}
* {{DocLink|QExplicitlySharedDataPointer}}
* {{DocLink|QExplicitlySharedDataPointer}}
Line 13: Line 12:
* {{DocLink|QSharedPointer}}
* {{DocLink|QSharedPointer}}
* {{DocLink|QWeakPointer}}
* {{DocLink|QWeakPointer}}
* {{DocLink|QPointer}} since Qt5 a wrapper around QWeakPointer.  The class was once planned to be deprecated but instead was kept to support legacy code.
* QGuard (internal class)
* QGuard (internal class)
* {{DocLink|QScopedPointer}}
* {{DocLink|QScopedPointer}}
Line 19: Line 19:
== See also ==
== See also ==


[http://blog.qt.io/blog/2009/08/25/count-with-me-how-many-smart-pointer-classes-does-qt-have/ Count with me: how many smart pointer classes does Qt have?]
* [http://blog.qt.io/blog/2009/08/25/count-with-me-how-many-smart-pointer-classes-does-qt-have/ Count with me: how many smart pointer classes does Qt have?]
* [http://www.macieira.org/blog/2012/07/continue-using-qpointer/ Continue using QPointer]


== References ==
== References ==


[http://en.wikipedia.org/wiki/Smart_pointers Smart Pointer]
[http://en.wikipedia.org/wiki/Smart_pointers Smart Pointer]

Latest revision as of 16:54, 3 November 2017

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Purpose

A smart pointer is an abstract data type that has all features of a standard pointer and additionally provides automatic garbage collection. Smart pointers facilitate the dynamic memory operations. Their main advantage is reducing memory leaks and bugs due to poor memory management.

Smart Pointers in Qt

See also

References

Smart Pointer