From bbbdf511be4afdb08d2a4d7c365a84adde7ae324 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 9 Nov 2009 18:10:23 +1000 Subject: More inDestructor checks. Declarative tripped these (crashes). Reviewed-by:Aaron Kennedy --- src/gui/graphicsview/qgraphicsitem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index a236b14..723e496 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3349,6 +3349,9 @@ QPointF QGraphicsItem::pos() const */ void QGraphicsItem::setX(qreal x) { + if (d_ptr->inDestructor) + return; + d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y())); } @@ -3370,6 +3373,9 @@ void QGraphicsItem::setX(qreal x) */ void QGraphicsItem::setY(qreal y) { + if (d_ptr->inDestructor) + return; + d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y)); } @@ -3435,6 +3441,9 @@ void QGraphicsItem::setPos(const QPointF &pos) if (d_ptr->pos == pos) return; + if (d_ptr->inDestructor) + return; + // Update and repositition. if (!(d_ptr->flags & ItemSendsGeometryChanges)) { d_ptr->setPosHelper(pos); -- cgit v0.12