diff options
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-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; |