QQmlData: Remove parentChanged code
The code which set parentFrozen is gone since 5ece9dc613bf12322753b18fe6b8da726b74ad33, lost in the migration from VME to V4. Judging by an old mailing list post (https://development.qt-project.narkive.com/6ygwVMAh/improving-qtquick-internals-was-re-qml-engine-changes#post8) too much would break if that check were actually enabled (which is probably the reason why this code started to bit-rot). Task-number: QTBUG-82931 Change-Id: Ibdc68957c6adf6198f6c59b65e19e78a66039f00 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
5084229284
commit
86e9e61cad
|
@ -98,7 +98,7 @@ public:
|
|||
if (!initialized) {
|
||||
initialized = true;
|
||||
QAbstractDeclarativeData::destroyed = destroyed;
|
||||
QAbstractDeclarativeData::parentChanged = parentChanged;
|
||||
QAbstractDeclarativeData::parentChanged = nullptr;
|
||||
QAbstractDeclarativeData::signalEmitted = signalEmitted;
|
||||
QAbstractDeclarativeData::receivers = receivers;
|
||||
QAbstractDeclarativeData::isSignalConnected = isSignalConnected;
|
||||
|
@ -106,13 +106,11 @@ 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);
|
||||
|
||||
void destroyed(QObject *);
|
||||
void parentChanged(QObject *, QObject *);
|
||||
|
||||
void setImplicitDestructible() {
|
||||
if (!explicitIndestructibleSet) indestructible = false;
|
||||
|
@ -141,8 +139,7 @@ public:
|
|||
// set when at least one of the object's properties is intercepted
|
||||
quint32 hasInterceptorMetaObject:1;
|
||||
quint32 hasVMEMetaObject:1;
|
||||
quint32 parentFrozen:1;
|
||||
quint32 dummy:7;
|
||||
quint32 dummy:8;
|
||||
|
||||
// When bindingBitsSize < sizeof(ptr), we store the binding bit flags inside
|
||||
// bindingBitsValue. When we need more than sizeof(ptr) bits, we allocated
|
||||
|
|
|
@ -653,7 +653,7 @@ void QQmlPrivate::qdeclarativeelement_destructor(QObject *o)
|
|||
QQmlData::QQmlData()
|
||||
: ownMemory(true), indestructible(true), explicitIndestructibleSet(false),
|
||||
hasTaintedV4Object(false), isQueuedForDeletion(false), rootObjectInCreation(false),
|
||||
hasInterceptorMetaObject(false), hasVMEMetaObject(false), parentFrozen(false),
|
||||
hasInterceptorMetaObject(false), hasVMEMetaObject(false),
|
||||
bindingBitsArraySize(InlineBindingArraySize), notifyList(nullptr),
|
||||
bindings(nullptr), signalHandlers(nullptr), nextContextObject(nullptr), prevContextObject(nullptr),
|
||||
lineNumber(0), columnNumber(0), jsEngineId(0),
|
||||
|
@ -673,11 +673,6 @@ void QQmlData::destroyed(QAbstractDeclarativeData *d, QObject *o)
|
|||
ddata->destroyed(o);
|
||||
}
|
||||
|
||||
void QQmlData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QObject *p)
|
||||
{
|
||||
QQmlData *ddata = static_cast<QQmlData *>(d);
|
||||
ddata->parentChanged(o, p);
|
||||
}
|
||||
|
||||
class QQmlThreadNotifierProxyObject : public QObject
|
||||
{
|
||||
|
@ -1699,25 +1694,6 @@ void QQmlData::destroyed(QObject *object)
|
|||
this->~QQmlData();
|
||||
}
|
||||
|
||||
DEFINE_BOOL_CONFIG_OPTION(parentTest, QML_PARENT_TEST);
|
||||
|
||||
void QQmlData::parentChanged(QObject *object, QObject *parent)
|
||||
{
|
||||
if (parentTest()) {
|
||||
if (parentFrozen && !QObjectPrivate::get(object)->wasDeleted) {
|
||||
QString on;
|
||||
QString pn;
|
||||
|
||||
{ QDebug dbg(&on); dbg << object; on = on.left(on.length() - 1); }
|
||||
{ QDebug dbg(&pn); dbg << parent; pn = pn.left(pn.length() - 1); }
|
||||
|
||||
qFatal("Object %s has had its parent frozen by QML and cannot be changed.\n"
|
||||
"User code is attempting to change it to %s.\n"
|
||||
"This behavior is NOT supported!", qPrintable(on), qPrintable(pn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QQmlData::BindingBitsType *QQmlData::growBits(QObject *obj, int bit)
|
||||
{
|
||||
BindingBitsType *bits = (bindingBitsArraySize == InlineBindingArraySize) ? bindingBitsValue : bindingBits;
|
||||
|
|
Loading…
Reference in New Issue