Fix for co-existence of QtDeclarative and QtQml

As a follow-up to commit 2f87fde9bb, we also need
to change "hack" in the QGraphicsItem and QWidget destructor for early item
destruction to support the _qml1 variant of the QObject destroyed callback.

Task-number: QTBUG-35006

Change-Id: I65e37b1e9ddd8d14267aaba024408611b8cd3d77
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
bb10
Simon Hausmann 2013-11-26 10:45:53 +01:00 committed by The Qt Project
parent 9b8570c4e9
commit e903b5cdda
2 changed files with 8 additions and 2 deletions

View File

@ -1414,7 +1414,10 @@ QGraphicsItem::~QGraphicsItem()
QObjectPrivate *p = QObjectPrivate::get(o);
p->wasDeleted = true;
if (p->declarativeData) {
QAbstractDeclarativeData::destroyed(p->declarativeData, o);
if (QAbstractDeclarativeData::destroyed)
QAbstractDeclarativeData::destroyed(p->declarativeData, o);
if (QAbstractDeclarativeData::destroyed_qml1)
QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o);
p->declarativeData = 0;
}
}

View File

@ -1464,7 +1464,10 @@ QWidget::~QWidget()
}
if (d->declarativeData) {
QAbstractDeclarativeData::destroyed(d->declarativeData, this);
if (QAbstractDeclarativeData::destroyed)
QAbstractDeclarativeData::destroyed(d->declarativeData, this);
if (QAbstractDeclarativeData::destroyed_qml1)
QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
d->declarativeData = 0; // don't activate again in ~QObject
}