diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 5387d549c6c..2dcfa336297 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -64,6 +64,7 @@ #include #include +#include #include @@ -820,6 +821,7 @@ QObject::QObject(QObject *parent) #endif if (Q_UNLIKELY(qtHookData[QHooks::AddQObject])) reinterpret_cast(qtHookData[QHooks::AddQObject])(this); + Q_TRACE(QObject_ctor, this); } /*! @@ -855,6 +857,7 @@ QObject::QObject(QObjectPrivate &dd, QObject *parent) #endif if (Q_UNLIKELY(qtHookData[QHooks::AddQObject])) reinterpret_cast(qtHookData[QHooks::AddQObject])(this); + Q_TRACE(QObject_ctor, this); } /*! @@ -1030,6 +1033,8 @@ QObject::~QObject() if (Q_UNLIKELY(qtHookData[QHooks::RemoveQObject])) reinterpret_cast(qtHookData[QHooks::RemoveQObject])(this); + Q_TRACE(QObject_dtor, this); + if (d->parent) // remove it from parent object d->setParent_helper(0); } diff --git a/src/corelib/qtcore.tracepoints b/src/corelib/qtcore.tracepoints index 391e4087e55..2e78490ab54 100644 --- a/src/corelib/qtcore.tracepoints +++ b/src/corelib/qtcore.tracepoints @@ -20,3 +20,6 @@ QCoreApplication_notify_entry(QObject *receiver, QEvent *event, int type) QCoreApplication_notify_event_filtered(QObject *receiver, QEvent *event, int type) QCoreApplication_notify_before_delivery(QObject *receiver, QEvent *event, int type) QCoreApplication_notify_after_delivery(QObject *receiver, QEvent *event, int type, bool consumed) + +QObject_ctor(QObject *object) +QObject_dtor(QObject *object)