summaryrefslogtreecommitdiffstats
path: root/src/gui/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/effects')
-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);
}