Re: [Development] QtCore: qt_addObject and qt_removeObject
On quinta-feira, 3 de maio de 2012 14.53.44, Adriano Rezende wrote: Hi, Currently we have these 2 functions in qobject.cpp: extern C Q_CORE_EXPORT void qt_addObject(QObject *) {} extern C Q_CORE_EXPORT void qt_removeObject(QObject *) {} The qt_addObject is being called in the QObject constructor and qt_removeObject in the destructor. It seems that they are being overloaded via ld_preload by some profiling tools like Squish to do some tracing. I'm also using them to trace QObjects lifetime in QML applications. I think this kind of tracing is interesting to have in QtCreator and also in some other external tools. The problem is that this approach is not multiplatform and we don't have any guarantee that these functions will not be removed by accident. They won't be removed by accident because, at least for those, we know exactly what they are. My suggestion is to replace them by callbacks and keep the setters in a private header. Someone is against this idea? Not at all. I suggested that the Squish and Gamma Ray developers get together and put together a proper callback implementation set, which we'll gladly use in Qt 5. I don't think that is high in their priority list, though. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center Intel Sweden AB - Registration Number: 556189-6027 Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden signature.asc Description: This is a digitally signed message part. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] QtCore: qt_addObject and qt_removeObject
On Thursday, May 03, 2012 15:07:47 Thiago Macieira wrote: On quinta-feira, 3 de maio de 2012 14.53.44, Adriano Rezende wrote: Hi, Currently we have these 2 functions in qobject.cpp: extern C Q_CORE_EXPORT void qt_addObject(QObject *) {} extern C Q_CORE_EXPORT void qt_removeObject(QObject *) {} The qt_addObject is being called in the QObject constructor and qt_removeObject in the destructor. It seems that they are being overloaded via ld_preload by some profiling tools like Squish to do some tracing. I'm also using them to trace QObjects lifetime in QML applications. I think this kind of tracing is interesting to have in QtCreator and also in some other external tools. The problem is that this approach is not multiplatform and we don't have any guarantee that these functions will not be removed by accident. They won't be removed by accident because, at least for those, we know exactly what they are. My suggestion is to replace them by callbacks and keep the setters in a private header. Someone is against this idea? Not at all. I suggested that the Squish and Gamma Ray developers We like the idea a lot, but it was already too late for Qt 5.0. get together and put together a proper callback implementation set, which we'll gladly use in Qt 5. I don't think that is high in their priority list, though. Thanks, -- Stephen Kelly stephen.ke...@kdab.com | Software Engineer KDAB (Deutschland) GmbH Co.KG, a KDAB Group Company www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-Independent Software Solutions signature.asc Description: This is a digitally signed message part. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development
Re: [Development] QtCore: qt_addObject and qt_removeObject
On Thu, 3 May 2012, Thiago Macieira wrote: My suggestion is to replace them by callbacks and keep the setters in a private header. Someone is against this idea? Not at all. I suggested that the Squish and Gamma Ray developers get together and put together a proper callback implementation set, which we'll gladly use in Qt 5. I don't think that is high in their priority list, though. Oh, I missed that call. But we are happy to participate in a discussion. In Berlin for example. Harri. ___ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development