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
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Developing_with_Qt::General]] | |||
'''English''' [[Smart_Pointers_Bulgarian|Български]] [[Smart_Pointers_Russian|Русский]] | |||
==Purpose== | = Smart Pointers = | ||
== 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. | 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 | ||
* | * "QSharedDataPointer":http://doc.qt.io/latest/qshareddatapointer.html | ||
* | * "QExplicitlySharedDataPointer":http://doc.qt.io/latest/qexplicitlyshareddatapointer.html | ||
* QtPatternist::AutoPtr (internal class) | * QtPatternist::AutoPtr (internal class) | ||
* | * "QSharedPointer":http://doc.qt.io/latest/qsharedpointer.html | ||
* | * "QWeakPointer":http://doc.qt.io/latest/qweakpointer.html | ||
* QGuard (internal class) | * QGuard (internal class) | ||
* | * "QScopedPointer":http://doc.qt.io/latest/qscopedpointer.html | ||
= | = 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/ | |||
= | = References = | ||
"Smart Pointer":http://en.wikipedia.org/wiki/Smart_pointers | |||
Revision as of 14:41, 23 February 2015
Smart Pointers
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.
Smart Pointers in Qt
- "QPointer":http://doc.qt.io/latest/qpointer.html
- "QSharedDataPointer":http://doc.qt.io/latest/qshareddatapointer.html
- "QExplicitlySharedDataPointer":http://doc.qt.io/latest/qexplicitlyshareddatapointer.html
- QtPatternist::AutoPtr (internal class)
- "QSharedPointer":http://doc.qt.io/latest/qsharedpointer.html
- "QWeakPointer":http://doc.qt.io/latest/qweakpointer.html
- QGuard (internal class)
- "QScopedPointer":http://doc.qt.io/latest/qscopedpointer.html
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/
References
"Smart Pointer":http://en.wikipedia.org/wiki/Smart_pointers