summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-24 17:30:19 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-24 17:34:28 (GMT)
commitdc40eeacdca375ac03e5d7b6a6c183609c6b9889 (patch)
treeae2d36d4f6c72f43227f7fa96191442aec742026
parentb4425cc1ad39879901247fd488825a3f6c30111a (diff)
downloadQt-dc40eeacdca375ac03e5d7b6a6c183609c6b9889.zip
Qt-dc40eeacdca375ac03e5d7b6a6c183609c6b9889.tar.gz
Qt-dc40eeacdca375ac03e5d7b6a6c183609c6b9889.tar.bz2
Make sure QGraphicsOpacityEffect::opacity is bound between 0.0 and 1.0
-rw-r--r--src/gui/effects/qgraphicseffect.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 2fe0964..ab02999 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -907,8 +907,11 @@ qreal QGraphicsOpacityEffect::opacity() const
void QGraphicsOpacityEffect::setOpacity(qreal opacity)
{
Q_D(QGraphicsOpacityEffect);
+ opacity = qBound(qreal(0.0), opacity, qreal(1.0));
+
if (qFuzzyCompare(d->opacity, opacity))
return;
+
d->opacity = opacity;
emit opacityChanged(opacity);
}