summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-08 15:31:01 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-26 14:37:34 (GMT)
commit5241ca84e0884e9d0814094eb6949ae27b19c6f9 (patch)
tree5f24471af05d4393103e1b78155765e2d94e9c5f /src/gui/graphicsview/qgraphicsscene.cpp
parent5ccd8ceb06a9be29f773d170d5dd8c67a8d6c86d (diff)
downloadQt-5241ca84e0884e9d0814094eb6949ae27b19c6f9.zip
Qt-5241ca84e0884e9d0814094eb6949ae27b19c6f9.tar.gz
Qt-5241ca84e0884e9d0814094eb6949ae27b19c6f9.tar.bz2
Fixes visibility update missing when doing setParentItem on graphicsitem
Calling setParentItem is causing the previous opacity/visible updates to be discarded because the dirty flags were not propagated to the new parent. Also removed some unnecessary 'markDirty' and 'update' calls. Task-number: QTBUG-6738 Reviewed-by: bnilsen
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ae48bee..9219773 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1955,7 +1955,7 @@ QList<QGraphicsItem *> QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSe
\since 4.3
This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode).
-
+
This function is deprecated and returns incorrect results if the scene
contains items that ignore transformations. Use the overload that takes
a QTransform instead.
@@ -4903,17 +4903,7 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
if (ignoreOpacity)
item->d_ptr->ignoreOpacity = 1;
- QGraphicsItem *p = item->d_ptr->parent;
- while (p) {
- p->d_ptr->dirtyChildren = 1;
-#ifndef QT_NO_GRAPHICSEFFECT
- if (p->d_ptr->graphicsEffect && p->d_ptr->graphicsEffect->isEnabled()) {
- p->d_ptr->dirty = 1;
- p->d_ptr->fullUpdatePending = 1;
- }
-#endif //QT_NO_GRAPHICSEFFECT
- p = p->d_ptr->parent;
- }
+ item->d_ptr->markParentDirty();
}
static inline bool updateHelper(QGraphicsViewPrivate *view, QGraphicsItemPrivate *item,