diff options
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 6 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 1e2c09b..df07b87 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -246,6 +246,12 @@ public: void invalidateCachedClipPathRecursively(bool childrenOnly = false); + inline bool isInvisible() const + { + return !visible || (hasEffectiveOpacity + && qFuzzyCompare(q_func()->effectiveOpacity() + 1.0, qreal(1.0))); + } + QPainterPath cachedClipPath; QPointF pos; qreal z; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 3db8e35..1422184 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1552,7 +1552,7 @@ void QGraphicsScenePrivate::childItems_helper(QList<QGraphicsItem *> *items, continue; // Skip invisible items and all their children. - if (!item->d_ptr->visible || qFuzzyCompare(item->effectiveOpacity(), qreal(0.0))) + if (item->d_ptr->isInvisible()) continue; // ### _q_adjustedRect is only needed because QRectF::intersects, @@ -1612,7 +1612,7 @@ void QGraphicsScenePrivate::childItems_helper(QList<QGraphicsItem *> *items, continue; // Skip invisible items. - if (!item->d_ptr->visible || qFuzzyCompare(item->effectiveOpacity() + 1, qreal(1.0))) + if (item->d_ptr->isInvisible()) continue; // ### _q_adjustedRect is only needed because QRectF::intersects, @@ -1666,7 +1666,7 @@ void QGraphicsScenePrivate::childItems_helper(QList<QGraphicsItem *> *items, continue; // Skip invisible items. - if (!item->d_ptr->visible || qFuzzyCompare(item->effectiveOpacity(), qreal(0.0))) + if (item->d_ptr->isInvisible()) continue; // ### _q_adjustedRect is only needed because QRectF::intersects, |