diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-01-19 12:18:55 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-01-27 15:30:20 (GMT) |
commit | dd29275d302ca10b9b07c4cc246402036b854830 (patch) | |
tree | 6c236e6e6dd2a50f81b26c31e9115ac8fdf5245e /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | 33fb442f7e95c0bf5af800f5b96fc3d78bffdd98 (diff) | |
download | Qt-dd29275d302ca10b9b07c4cc246402036b854830.zip Qt-dd29275d302ca10b9b07c4cc246402036b854830.tar.gz Qt-dd29275d302ca10b9b07c4cc246402036b854830.tar.bz2 |
Pass value as const void *const to QGraphicsSceneIndex::itemChange.
We need this change in order to bypass some of the QVariant itemChange
notifications from QGraphicsItem::setParentItem. All this is internal
stuff and we know what we do, so I don't consider the change too ugly.
Task-number: QTBUG-6877
Reviewed-by: alexis
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 8196829..d66e9b6 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1033,7 +1033,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent) if (scene) { // Deliver the change to the index if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex) - scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParentVariant); + scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent); // Disable scene pos notifications for old ancestors if (scenePosDescendants || (flags & QGraphicsItem::ItemSendsScenePositionChanges)) @@ -1719,7 +1719,7 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) if (quint32(d_ptr->flags) == quint32(flags)) return; if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex) - d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, quint32(flags)); + d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags); // Flags that alter the geometry of the item (or its children). const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable); @@ -4301,9 +4301,9 @@ void QGraphicsItem::setZValue(qreal z) if (newZ == d_ptr->z) return; - if (d_ptr->scene) { + if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex) { // Z Value has changed, we have to notify the index. - d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, newZVariant); + d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, &newZ); } d_ptr->z = newZ; |