diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-24 17:30:19 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-24 17:34:28 (GMT) |
commit | dc40eeacdca375ac03e5d7b6a6c183609c6b9889 (patch) | |
tree | ae2d36d4f6c72f43227f7fa96191442aec742026 | |
parent | b4425cc1ad39879901247fd488825a3f6c30111a (diff) | |
download | Qt-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.cpp | 3 |
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); } |