diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-17 08:20:46 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-17 08:27:06 (GMT) |
commit | 99c5b68d4af7b099f201a7b89c86209df9e9349b (patch) | |
tree | 22b25459c74d80b8c2eacfc3b2b314454fd6ae71 /src/gui | |
parent | c441020f105249458c389cc167d70f36b39ea28e (diff) | |
download | Qt-99c5b68d4af7b099f201a7b89c86209df9e9349b.zip Qt-99c5b68d4af7b099f201a7b89c86209df9e9349b.tar.gz Qt-99c5b68d4af7b099f201a7b89c86209df9e9349b.tar.bz2 |
Fix QGraphicsItem::ItemHasNoContents rendering of children.
The ItemHasNoContents flag was preventing items that clip their children
from rendering their children at all. Fixed now.
Reviewed-by: bnilsen
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 1b5af07..811e0d3 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5074,7 +5074,8 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * } // Item is invisible. - bool invisible = !item || ((item->d_ptr->flags & QGraphicsItem::ItemHasNoContents) || invisibleButChildIgnoresParentOpacity); + bool hasContents = item && !(item->d_ptr->flags & QGraphicsItem::ItemHasNoContents); + bool invisible = !hasContents || invisibleButChildIgnoresParentOpacity; // Calculate the full transform for this item. bool wasDirtyParentSceneTransform = false; @@ -5161,7 +5162,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * } bool childClip = (item && (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape)); - bool dontDrawChildren = item && dontDrawItem && childClip; + bool dontDrawChildren = item && hasContents && dontDrawItem && childClip; childClip &= !dontDrawChildren && !children->isEmpty(); if (item && invisible) dontDrawItem = true; |