summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-03-18 12:27:16 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:43 (GMT)
commitbd4b177e051852f0fb94df9c0ee2e512478e0d38 (patch)
tree0d349b723d43a9f1513392af5904e799943e93fd /src/gui/graphicsview/qgraphicsitem_p.h
parent4d019e66fb62d6f25627144539abd7f59413abee (diff)
downloadQt-bd4b177e051852f0fb94df9c0ee2e512478e0d38.zip
Qt-bd4b177e051852f0fb94df9c0ee2e512478e0d38.tar.gz
Qt-bd4b177e051852f0fb94df9c0ee2e512478e0d38.tar.bz2
Fixes: Get rid of lots of calls to qFuzzyCompare.
RevBy: Olivier AutoTest: Still pass. Details: Items usually don't have effective opacity, i.e. it is 1.0, so don't bother doing fuzzy compare if that's the case.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h6
1 files changed, 6 insertions, 0 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;