diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a729962d4f..4d2f801c7b 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -167,7 +167,6 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *) #endif void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = nullptr; -void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = nullptr; void (*QAbstractDeclarativeData::signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **) = nullptr; int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QObject *, int) = nullptr; bool (*QAbstractDeclarativeData::isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int) = nullptr; @@ -2110,8 +2109,6 @@ void QObjectPrivate::setParent_helper(QObject *o) } } } - if (!wasDeleted && !isDeletingChildren && declarativeData && QAbstractDeclarativeData::parentChanged) - QAbstractDeclarativeData::parentChanged(declarativeData, q, o); } /*! diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 4483e2b6ce..019473018f 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -89,7 +89,6 @@ class Q_CORE_EXPORT QAbstractDeclarativeData { public: static void (*destroyed)(QAbstractDeclarativeData *, QObject *); - static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *); static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **); static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int); static bool (*isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int); diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index a7b47438e0..e143aeed6d 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -154,7 +154,6 @@ private slots: void qmlConnect(); void qmlConnectToQObjectReceiver(); void exceptions(); - void noDeclarativeParentChangedOnDestruction(); void deleteLaterInAboutToBlockHandler(); void mutableFunctor(); void checkArgumentsForNarrowing(); @@ -6993,42 +6992,6 @@ void tst_QObject::exceptions() #endif } -#ifdef QT_BUILD_INTERNAL -static bool parentChangeCalled = false; - -static void testParentChanged(QAbstractDeclarativeData *, QObject *, QObject *) -{ - parentChangeCalled = true; -} -#endif - -void tst_QObject::noDeclarativeParentChangedOnDestruction() -{ -#ifdef QT_BUILD_INTERNAL - typedef void (*ParentChangedCallback)(QAbstractDeclarativeData *, QObject *, QObject *); - QScopedValueRollback rollback(QAbstractDeclarativeData::parentChanged); - QAbstractDeclarativeData::parentChanged = testParentChanged; - - QObject *parent = new QObject; - QObject *child = new QObject; - - QAbstractDeclarativeData dummy; - QObjectPrivate::get(child)->declarativeData = &dummy; - - parentChangeCalled = false; - child->setParent(parent); - - QVERIFY(parentChangeCalled); - parentChangeCalled = false; - - delete child; - QVERIFY(!parentChangeCalled); - - delete parent; -#else - QSKIP("Needs QT_BUILD_INTERNAL"); -#endif -} struct MutableFunctor { int count;