Smart Pointers: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(adds context on the existence of QPointer)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''English''' [[Smart Pointers Bulgarian|Български]] [[Smart Pointers Russian|Русский]]
{{LangSwitch}}
[[Category:Developing_with_Qt::General]]
== Purpose ==


=Smart Pointers=
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.


==Purpose==
== Smart Pointers in Qt ==


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.
* {{DocLink|QSharedDataPointer}}
 
* {{DocLink|QExplicitlySharedDataPointer}}
==Smart Pointers in Qt==
 
* [http://doc.qt.io/latest/qpointer.html QPointer] ''[qt.io]''
* [http://doc.qt.io/latest/qshareddatapointer.html QSharedDataPointer] ''[qt.io]''
* [http://doc.qt.io/latest/qexplicitlyshareddatapointer.html QExplicitlySharedDataPointer] ''[qt.io]''
* QtPatternist::AutoPtr (internal class)
* QtPatternist::AutoPtr (internal class)
* [http://doc.qt.io/latest/qsharedpointer.html QSharedPointer] ''[qt.io]''
* {{DocLink|QSharedPointer}}
* [http://doc.qt.io/latest/qweakpointer.html QWeakPointer] ''[qt.io]''
* {{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)
* [http://doc.qt.io/latest/qscopedpointer.html QScopedPointer] ''[qt.io]''
* {{DocLink|QScopedPointer}}
 
* {{DocLink|QScopedArrayPointer}}
=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?] ''[blog.qt.io]''


=References=
== See also ==


[http://en.wikipedia.org/wiki/Smart_pointers Smart Pointer] ''[en.wikipedia.org]''<br />[http://www.anavi.org/article/110/ Boost Shared Pointer] ''[anavi.org]''
* [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]


===Categories:===
== References ==


* [[:Category:Developing with Qt|Developing_with_Qt]]
[http://en.wikipedia.org/wiki/Smart_pointers Smart Pointer]
** [[:Category:Developing with Qt::General|General]]

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