summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-28 17:09:39 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-01-29 16:25:08 (GMT)
commit519760c4256997f26c039cb4b047c6207470b54f (patch)
treefdfd386e09caa36e11b95d69bd60d2d54b6c6754 /src/gui/graphicsview/qgraphicsitem_p.h
parent4a5e81f5320daa82352b13e670718998b0d2d23b (diff)
downloadQt-519760c4256997f26c039cb4b047c6207470b54f.zip
Qt-519760c4256997f26c039cb4b047c6207470b54f.tar.gz
Qt-519760c4256997f26c039cb4b047c6207470b54f.tar.bz2
Adds convenience functions QGraphicsItemPrivate::isOpacityNull
This should unify the error constant used along the code and enforce qreal to avoid unnecessary double conversions. Reviewed-by: bnilsen
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 5ad6cd5..b3ca3b5 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -358,14 +358,20 @@ public:
return o;
}
+ inline bool isOpacityNull() const
+ { return (opacity < qreal(0.001)); }
+
+ static inline bool isOpacityNull(qreal opacity)
+ { return (opacity < qreal(0.001)); }
+
inline bool isFullyTransparent() const
{
- if (opacity < 0.001)
+ if (isOpacityNull())
return true;
if (!parent)
return false;
- return calcEffectiveOpacity() < 0.001;
+ return isOpacityNull(calcEffectiveOpacity());
}
inline qreal effectiveOpacity() const {