diff options
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 150343e..9e0ec2e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1408,8 +1408,16 @@ QGraphicsItem::QGraphicsItem(QGraphicsItemPrivate &dd, QGraphicsItem *parent, */ QGraphicsItem::~QGraphicsItem() { - if (d_ptr->isObject) - QObjectPrivate::get(static_cast<QGraphicsObject *>(this))->wasDeleted = true; + if (d_ptr->isObject) { + QGraphicsObject *o = static_cast<QGraphicsObject *>(this); + QObjectPrivate *p = QObjectPrivate::get(o); + p->wasDeleted = true; + if (p->declarativeData) { + QDeclarativeData::destroyed(p->declarativeData, o); + p->declarativeData = 0; + } + } + d_ptr->inDestructor = 1; d_ptr->removeExtraItemCache(); |