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
Jump to navigation
Jump to search
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
- QSharedDataPointer
- QExplicitlySharedDataPointer
- QtPatternist::AutoPtr (internal class)
- QSharedPointer
- QWeakPointer
- 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)
- QScopedPointer
- QScopedArrayPointer