diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-26 10:45:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-26 10:57:54 +0100 |
commit | e903b5cddaaa606300292ad2cf26c2b6ee111cdd (patch) | |
tree | b29a001b7dc1e6dce61b8a2d6c6305eec3231dee /src | |
parent | 9b8570c4e9359eb8b45b39c28aa9d8c140f3fc44 (diff) |
Fix for co-existence of QtDeclarative and QtQml
As a follow-up to commit 2f87fde9bb4bad6787101c0d135419b350b201a5, 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>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 7cab132a2e..fffc805637 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -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; } } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 1da0be9781..421ce57096 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -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 } |