I've been working with Qt for somedays and I wonder why all their API uses plain pointers instead of their own smart pointers like QSharedPointer
.
Wouldn't it be more consistent to use them?
QSharedPointer
is implemented since Qt 4.5. In Qt, QObject
s organize themselves in object trees. When you create a QObject
, with another object as the parent, the former is added to the latter's children list and destroyed in the latter's destructor. So you do not need to use QSharedPointer
with its overhead.