diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/effects/qgraphicseffect.cpp | 34 | ||||
-rw-r--r-- | src/gui/effects/qgraphicseffect.h | 4 |
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); |