QObject: remove QAbstractDeclarativeData::parentChanged
The code in qtdeclarative did not do anything at all anymore. Change-Id: Idd97145cb74aeb4f43dfce2f282a765e90945073 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
d76c0e3224
commit
e8b7e4e96a
@ -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);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -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);
|
||||
|
@ -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<ParentChangedCallback> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user