summaryrefslogtreecommitdiffstats
path: root/src/gui/effects/qgraphicseffect.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 09:03:43 +0200
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 12:53:23 +0200
commit2a9ffbeda34c04bede04c1aac24eab13fc490fe9 (patch)
treee97596d20e4c9df4894885e30de688d30de926f8 /src/gui/effects/qgraphicseffect.cpp
parentc78c520bde91c08cedc6f7cc5c943998155f078e (diff)
Make sure graphics effects updates properly when changing their properties.
Reviewed-by: Leo
Diffstat (limited to 'src/gui/effects/qgraphicseffect.cpp')
-rw-r--r--src/gui/effects/qgraphicseffect.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index ccbf7fc66a..1e0ea53593 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -349,6 +349,22 @@ void QGraphicsEffect::setEnabled(bool enable)
*/
/*!
+ Schedules a redraw of the source. Call this function whenever the source
+ needs to be redrawn.
+
+ This convenience function is equivalent to calling
+ QGraphicsEffectSource::update().
+
+ \sa updateBoundingRect(), QGraphicsEffectSource::update()
+*/
+void QGraphicsEffect::update()
+{
+ Q_D(QGraphicsEffect);
+ if (d->source)
+ d->source->update();
+}
+
+/*!
Returns a pointer to the source, which provides extra context information
that can be useful for the effect.
@@ -366,6 +382,8 @@ QGraphicsEffectSource *QGraphicsEffect::source() const
function whenever you change any parameters that will cause the virtual
boundingRectFor() function to return a different value.
+ This function will call update() if this is necessary.
+
\sa boundingRectFor(), boundingRect()
*/
void QGraphicsEffect::updateBoundingRect()
@@ -523,6 +541,7 @@ void QGraphicsColorizeEffect::setColor(const QColor &color)
return;
d->filter->setColor(color);
+ update();
emit colorChanged(color);
}
@@ -610,6 +629,7 @@ void QGraphicsPixelizeEffect::setPixelSize(int size)
return;
d->pixelSize = size;
+ update();
emit pixelSizeChanged(size);
}
@@ -903,6 +923,7 @@ void QGraphicsDropShadowEffect::setColor(const QColor &color)
return;
d->filter->setColor(color);
+ update();
emit colorChanged(color);
}
@@ -1012,6 +1033,7 @@ void QGraphicsOpacityEffect::setOpacity(qreal opacity)
d->isFullyOpaque = 0;
else
d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1);
+ update();
emit opacityChanged(opacity);
}
@@ -1050,6 +1072,7 @@ void QGraphicsOpacityEffect::setOpacityMask(const QBrush &mask)
d->opacityMask = mask;
d->hasOpacityMask = (mask.style() != Qt::NoBrush);
+ update();
emit opacityMaskChanged(mask);
}