diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-22 11:24:44 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-22 11:26:38 (GMT) |
commit | 5a734e4657161e0877b32181df35a56241b21de4 (patch) | |
tree | f2c9fd4db16d054fe0f5a5676a85f32a514d8aa8 /src | |
parent | 87911c6c97b11bd7d10a38698460174b6cadfbe8 (diff) | |
download | Qt-5a734e4657161e0877b32181df35a56241b21de4.zip Qt-5a734e4657161e0877b32181df35a56241b21de4.tar.gz Qt-5a734e4657161e0877b32181df35a56241b21de4.tar.bz2 |
Fix the way the transform and the properties are marked as dirty in QGraphicsItem
Acknowledged-by: Thierry
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 9 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b7e88f4..828dd4f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2607,7 +2607,6 @@ QTransform QGraphicsItem::transform() const QVariant v(x); d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, v); d_ptr->dirtyTransform = 0; - d_ptr->dirtyTransformComponents = 1; const_cast<QGraphicsItem *>(this)->itemChange(ItemTransformHasChanged, v); return x; } @@ -3200,9 +3199,9 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine) prepareGeometryChange(); d_ptr->hasTransform = !newTransform.isIdentity(); d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, newTransform); + d_ptr->dirtyTransformComponents = 1; + d_ptr->dirtyTransform = 0; d_ptr->invalidateSceneTransformCache(); - if (d_ptr->hasDecomposedTransform) - d_ptr->dirtyTransform = 1; // Send post-notification. // NB! We have to change the value from QMatrix to QTransform. @@ -3253,9 +3252,9 @@ void QGraphicsItem::setTransform(const QTransform &matrix, bool combine) prepareGeometryChange(); d_ptr->hasTransform = !newTransform.isIdentity(); d_ptr->setExtra(QGraphicsItemPrivate::ExtraTransform, newTransform); + d_ptr->dirtyTransformComponents = 1; + d_ptr->dirtyTransform = 0; d_ptr->invalidateSceneTransformCache(); - if (d_ptr->hasDecomposedTransform) - d_ptr->dirtyTransform = 1; // Send post-notification. itemChange(ItemTransformHasChanged, newTransformVariant); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index cebc8ca..b2569c1 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -346,7 +346,7 @@ public: int globalStackingOrder; int sceneTransformIndex; - struct DecomposedTransform; + struct DecomposedTransform; DecomposedTransform *decomposedTransform() const { QGraphicsItemPrivate *that = const_cast<QGraphicsItemPrivate *>(this); |