summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-12-06 11:59:50 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2016-12-07 09:15:10 +0000
commit062be102283d39bf0cc2b49fbc2e21d48f79ea42 (patch)
treefa63541b1060a9b80729e2824281fc2d8aa2fd77 /src
parent1f8772698017875e75219109d2849e79ab84e1c7 (diff)
Mark qt_addObject/qt_removeObject for removal in Qt6
We now have qtHookData, which is a better (and cheaper) way to add hooks for object creation and deletion. For binary-compatibility reasons we cannot remove it in Qt5. Change-Id: Iecd9f4e1195f90279c395845fa26c6301b67b9a1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobject.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 4ae886150f..fd1c767b4c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -147,12 +147,13 @@ static inline QMutex *signalSlotLock(const QObject *o)
uint(quintptr(o)) % sizeof(_q_ObjectMutexPool)/sizeof(QBasicMutex)]);
}
-// ### Qt >= 5.6, remove qt_add/removeObject
+#if QT_VERSION < 0x60000
extern "C" Q_CORE_EXPORT void qt_addObject(QObject *)
{}
extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *)
{}
+#endif
struct QConnectionSenderSwitcher {
QObject *receiver;
@@ -811,7 +812,9 @@ QObject::QObject(QObject *parent)
QT_RETHROW;
}
}
+#if QT_VERSION < 0x60000
qt_addObject(this);
+#endif
if (Q_UNLIKELY(qtHookData[QHooks::AddQObject]))
reinterpret_cast<QHooks::AddQObjectCallback>(qtHookData[QHooks::AddQObject])(this);
}
@@ -844,7 +847,9 @@ QObject::QObject(QObjectPrivate &dd, QObject *parent)
QT_RETHROW;
}
}
+#if QT_VERSION < 0x60000
qt_addObject(this);
+#endif
if (Q_UNLIKELY(qtHookData[QHooks::AddQObject]))
reinterpret_cast<QHooks::AddQObjectCallback>(qtHookData[QHooks::AddQObject])(this);
}
@@ -1016,7 +1021,9 @@ QObject::~QObject()
if (!d->children.isEmpty())
d->deleteChildren();
+#if QT_VERSION < 0x60000
qt_removeObject(this);
+#endif
if (Q_UNLIKELY(qtHookData[QHooks::RemoveQObject]))
reinterpret_cast<QHooks::RemoveQObjectCallback>(qtHookData[QHooks::RemoveQObject])(this);