Hi, Il 15/10/25 16:30, Daniel Schürmann ha scritto:
HelloMy 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 <https://bugreports.qt.io/ browse/QTBUG-141134>
Do you have an implementation that you could push as a WIP on gerrit? Or at least post it here as a skeleton?
(Note that we can't look at non-trivial implementations that aren't in the public domain, because we'd then taint our Qt contributions. Conversely, you shouldn't contribute under the CLA non-trivial implementations for which you don't have the rights...)
As far as I understand, parented_ptr would be a "smart" pointer that simply asserts that the managed object has a parent, and that's it? Does it do it just in the destructor or also in the other operations (dereferencing operators, .get(), etc.)?
Thank you, -- Giuseppe D'Angelo | [email protected] | Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com KDAB - Trusted Software Excellence
smime.p7s
Description: Firma crittografica S/MIME
-- Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
