summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-30 12:57:08 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-30 14:42:16 (GMT)
commit7ca2f8ee15fbac8dce815678d7d63748d3187cb8 (patch)
tree9b702b104da0859e587dd504b59f448f9747a11d
parent53dd13e439932cb234fbfff9d0dcd97d67334329 (diff)
downloadQt-7ca2f8ee15fbac8dce815678d7d63748d3187cb8.zip
Qt-7ca2f8ee15fbac8dce815678d7d63748d3187cb8.tar.gz
Qt-7ca2f8ee15fbac8dce815678d7d63748d3187cb8.tar.bz2
Added QGraphicsBloomEffect::blurHint.
This allows the user to control whether to use a fast dynamic blur or a static high quality blur. Reviewed-by: Samuel
-rw-r--r--src/gui/effects/qgraphicseffect.cpp34
-rw-r--r--src/gui/effects/qgraphicseffect.h4
2 files changed, 38 insertions, 0 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 5fc61d7..4a59301 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -1363,6 +1363,40 @@ void QGraphicsBloomEffect::setBlurRadius(int radius)
}
/*!
+ \property QGraphicsBloomEffect::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.
+
+ By default, the blur hint is Qt::PerformanceHint.
+*/
+Qt::RenderHint QGraphicsBloomEffect::blurHint() const
+{
+ Q_D(const QGraphicsBloomEffect);
+ return d->blurFilter.blurHint();
+}
+
+void QGraphicsBloomEffect::setBlurHint(Qt::RenderHint hint)
+{
+ Q_D(QGraphicsBloomEffect);
+ if (d->blurFilter.blurHint() == hint)
+ return;
+
+ d->blurFilter.setBlurHint(hint);
+ emit blurHintChanged(hint);
+}
+
+/*!
+ \fn void QGraphicsBloomEffect::blurHintChanged(Qt::RenderHint hint)
+
+ This signal is emitted whenever the effect's blur hint changes.
+ The \a hint parameter holds the effect's new blur hint.
+*/
+
+/*!
\property QGraphicsBloomEffect::brightness
\brief the brightness of the glow.
diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h
index a92ce13..c5d3ede 100644
--- a/src/gui/effects/qgraphicseffect.h
+++ b/src/gui/effects/qgraphicseffect.h
@@ -339,6 +339,7 @@ class Q_GUI_EXPORT QGraphicsBloomEffect: public QGraphicsEffect
{
Q_OBJECT
Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged)
+ Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged)
Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged)
Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)
public:
@@ -347,16 +348,19 @@ public:
QRectF boundingRectFor(const QRectF &rect) const;
int blurRadius() const;
+ Qt::RenderHint blurHint() const;
int brightness() const;
qreal strength() const;
public Q_SLOTS:
void setBlurRadius(int blurRadius);
+ void setBlurHint(Qt::RenderHint hint);
void setBrightness(int brightness);
void setStrength(qreal strength);
Q_SIGNALS:
void blurRadiusChanged(int blurRadius);
+ void blurHintChanged(Qt::RenderHint hint);
void brightnessChanged(int brightness);
void strengthChanged(qreal strength);