diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-05-27 00:25:04 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-05-27 00:25:04 (GMT) |
commit | fb5d338236976690312660bc017a8fe1e199326f (patch) | |
tree | f126ea5dfb367fc5212a62652162b84e86513aa4 /src/gui/graphicsview | |
parent | 487c05895751985a695f117fd984d1ecfe7b1252 (diff) | |
parent | 84f35321b867894470391d4997b5d58e34bce0ed (diff) | |
download | Qt-fb5d338236976690312660bc017a8fe1e199326f.zip Qt-fb5d338236976690312660bc017a8fe1e199326f.tar.gz Qt-fb5d338236976690312660bc017a8fe1e199326f.tar.bz2 |
Merge remote branch 'origin/4.7' into oslo-staging-1
Conflicts:
doc/src/declarative/advtutorial.qdoc
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index ae0abf9..22c3f92 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4889,6 +4889,24 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b if (updateAll) return; + if (removingItemFromScene && !ignoreOpacity && !item->d_ptr->ignoreOpacity) { + // If any of the item's ancestors ignore opacity, it means that the opacity + // was set to 0 (and the update request has not yet been processed). That + // also means that we have to ignore the opacity for the item itself; otherwise + // things like: parent->setOpacity(0); scene->removeItem(child) won't work. + // Note that we only do this when removing items from the scene. In all other + // cases the ignoreOpacity bit propagates properly in processDirtyItems, but + // since the item is removed immediately it won't be processed there. + QGraphicsItem *p = item->d_ptr->parent; + while (p) { + if (p->d_ptr->ignoreOpacity) { + item->d_ptr->ignoreOpacity = true; + break; + } + p = p->d_ptr->parent; + } + } + if (item->d_ptr->discardUpdateRequest(/*ignoreVisibleBit=*/force, /*ignoreDirtyBit=*/removingItemFromScene || invalidateChildren, /*ignoreOpacity=*/ignoreOpacity)) { |