[Development] parented_ptr

Daniel Schürmann daschuer at mixxx.org
Wed Oct 15 16:30:20 CEST 2025


Hello

My name is Daniel Schürmann and I am one of the core members in the Mixxx
team. We develop the QT based FOSS DJ software Mixxx.

Since a couple of years we use a custom smart pointer to wrap pointers to
QObjects, where the lifetime is managed by the QT object tree.

This is very useful for two reasons:
* In reviews it is clear that there is no explicit delete required, it
eliminates the nowadays exceptional case of new() without delete().
* The pointer asserts that the object has actually a parent and is not
leaked.

It has proven to be useful and disappointing that it is not available in
all my QT projects. That's why I like to discuss to put it or anything
similar into the QT source itself.

I have provided some more details in a QT bug here:
https://bugreports.qt.io/browse/QTBUG-141134

What do you think?

Best regards,

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20251015/5a530364/attachment.htm>


More information about the Development mailing list