Smart Pointers: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add "cleanup" tag)
(adds context on the existence of QPointer)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
{{LangSwitch}}
 
[[Category:Developing_with_Qt::General]]
[[Category:Developing_with_Qt::General]]
'''English''' [[Smart_Pointers_Bulgarian|Български]] [[Smart_Pointers_Russian|Русский]]
= Smart Pointers =
== Purpose ==
== Purpose ==


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


* "QPointer":http://doc.qt.io/latest/qpointer.html
* {{DocLink|QSharedDataPointer}}
* "QSharedDataPointer":http://doc.qt.io/latest/qshareddatapointer.html
* {{DocLink|QExplicitlySharedDataPointer}}
* "QExplicitlySharedDataPointer":http://doc.qt.io/latest/qexplicitlyshareddatapointer.html
* QtPatternist::AutoPtr (internal class)
* QtPatternist::AutoPtr (internal class)
* "QSharedPointer":http://doc.qt.io/latest/qsharedpointer.html
* {{DocLink|QSharedPointer}}
* "QWeakPointer":http://doc.qt.io/latest/qweakpointer.html
* {{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)
* "QScopedPointer":http://doc.qt.io/latest/qscopedpointer.html
* {{DocLink|QScopedPointer}}
* {{DocLink|QScopedArrayPointer}}


= See also =
== See also ==


"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/
* [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 ==


"Smart Pointer":http://en.wikipedia.org/wiki/Smart_pointers
[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