summaryrefslogtreecommitdiffstats
path: root/src/gui/effects/qgraphicseffect.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-10-30 14:26:55 +0100
committerSamuel Rødal <sroedal@trolltech.com>2009-11-02 12:57:54 +0100
commit2a902676b74d0aa3482e722602879f7a02be1103 (patch)
tree33109034e7b39dd9611c14c34b67936261139fc8 /src/gui/effects/qgraphicseffect.cpp
parent70b7f26c3155e83d59cae7b89ed1af3b57797a73 (diff)
Moved Qt::RenderHint back into QGraphicsBlurEffect and added a hint.
Added AnimationHint, which didn't make too much sense in a generic enum, so Qt::RenderHint was moved back into QGraphicsBlurEffect as QGraphicsBlurEffect::BlurHint. Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/effects/qgraphicseffect.cpp')
-rw-r--r--src/gui/effects/qgraphicseffect.cpp37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index c8e39daa18..e181b1857f 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -613,6 +613,26 @@ void QGraphicsColorizeEffect::draw(QPainter *painter, QGraphicsEffectSource *sou
*/
/*!
+ \enum QGraphicsBlurEffect::BlurHint
+ \since 4.6
+
+ This enum describes the possible hints that can be used to control how
+ blur effects are applied. The hints might not have an effect in all the
+ paint engines.
+
+ \value QualityHint Indicates that rendering quality is the most important factor,
+ at the potential cost of lower performance.
+
+ \value PerformanceHint Indicates that rendering performance is the most important factor,
+ at the potential cost of lower quality.
+
+ \value AnimationHint Indicates that the blur radius is going to be animated, hinting
+ that the implementation can keep a cache of blurred verisons of the source pixmap.
+ Do not use this hint if the source item is going to be dynamically changing.
+*/
+
+
+/*!
Constructs a new QGraphicsBlurEffect instance.
The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
@@ -620,7 +640,7 @@ QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent)
{
Q_D(QGraphicsBlurEffect);
- d->filter->setBlurHint(Qt::PerformanceHint);
+ d->filter->setBlurHint(QGraphicsBlurEffect::PerformanceHint);
}
/*!
@@ -667,20 +687,19 @@ void QGraphicsBlurEffect::setBlurRadius(qreal radius)
\property QGraphicsBlurEffect::blurHint
\brief the blur hint of the effect.
- Use the Qt::PerformanceHint hint to say that you want a faster blur,
- and the Qt::QualityHint hint to say that you prefer a higher quality blur.
-
- When animating the blur radius it's recommended to use Qt::PerformanceHint.
+ Use the PerformanceHint hint to say that you want a faster blur,
+ the QualityHint hint to say that you prefer a higher quality blur,
+ or the AnimationHint when you want to animate the blur radius.
- By default, the blur hint is Qt::PerformanceHint.
+ By default, the blur hint is PerformanceHint.
*/
-Qt::RenderHint QGraphicsBlurEffect::blurHint() const
+QGraphicsBlurEffect::BlurHint QGraphicsBlurEffect::blurHint() const
{
Q_D(const QGraphicsBlurEffect);
return d->filter->blurHint();
}
-void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint)
+void QGraphicsBlurEffect::setBlurHint(QGraphicsBlurEffect::BlurHint hint)
{
Q_D(QGraphicsBlurEffect);
if (d->filter->blurHint() == hint)
@@ -691,7 +710,7 @@ void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint)
}
/*!
- \fn void QGraphicsBlurEffect::blurHintChanged(Qt::RenderHint hint)
+ \fn void QGraphicsBlurEffect::blurHintChanged(Qt::BlurHint hint)
This signal is emitted whenever the effect's blur hint changes.
The \a hint parameter holds the effect's new blur hint.