QGraphicsBlurEffect Class

The QGraphicsBlurEffect class provides a blur effect. 更多...

頭: #include <QGraphicsBlurEffect>
qmake: QT += widgets
Since: Qt 4.6
繼承: QGraphicsEffect

公共類型

enum BlurHint { PerformanceHint, QualityHint, AnimationHint }
flags BlurHints

特性

公共函數

QGraphicsBlurEffect (QObject * parent = Q_NULLPTR)
~QGraphicsBlurEffect ()
BlurHints blurHints () const
qreal blurRadius () const

重實現公共函數

virtual QRectF boundingRectFor (const QRectF & rect ) const

公共槽

void setBlurHints (BlurHints hints )
void setBlurRadius (qreal blurRadius )

信號

void blurHintsChanged (BlurHints hints )
void blurRadiusChanged (qreal radius )

重實現保護函數

virtual void draw (QPainter * painter )

額外繼承成員

詳細描述

The QGraphicsBlurEffect class provides a blur effect.

A blur effect blurs the source. This effect is useful for reducing details, such as when the source loses focus and you want to draw attention to other elements. The level of detail can be modified using the setBlurRadius () function. Use setBlurHints () to choose the blur hints.

By default, the blur radius is 5 pixels. The blur radius is specified in device coordinates.

另請參閱 QGraphicsDropShadowEffect , QGraphicsColorizeEffect ,和 QGraphicsOpacityEffect .

成員類型文檔編製

enum QGraphicsBlurEffect:: BlurHint
flags QGraphicsBlurEffect:: BlurHints

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.

常量 描述
QGraphicsBlurEffect::PerformanceHint 0x00 Indicates that rendering performance is the most important factor, at the potential cost of lower quality.
QGraphicsBlurEffect::QualityHint 0x01 Indicates that rendering quality is the most important factor, at the potential cost of lower performance.
QGraphicsBlurEffect::AnimationHint 0x02 Indicates that the blur radius is going to be animated, hinting that the implementation can keep a cache of blurred verisons of the source. Do not use this hint if the source is going to be dynamically changing.

該枚舉在 Qt 4.6 引入或被修改。

The BlurHints type is a typedef for QFlags <BlurHint>. It stores an OR combination of BlurHint values.

另請參閱 blurHints () 和 setBlurHints ().

特性文檔編製

blurHints : BlurHints

This property holds the blur hint of the effect.

使用 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 PerformanceHint .

訪問函數:

BlurHints blurHints () const
void setBlurHints (BlurHints hints )

通知程序信號:

void blurHintsChanged (BlurHints hints )

blurRadius : qreal

This property holds the blur radius of the effect.

Using a smaller radius results in a sharper appearance, whereas a bigger radius results in a more blurred appearance.

By default, the blur radius is 5 pixels.

The radius is given in device coordinates, meaning it is unaffected by scale.

訪問函數:

qreal blurRadius () const
void setBlurRadius (qreal blurRadius )

通知程序信號:

void blurRadiusChanged (qreal radius )

成員函數文檔編製

QGraphicsBlurEffect:: QGraphicsBlurEffect ( QObject * parent = Q_NULLPTR)

構造新的 QGraphicsBlurEffect instance. The parent 參數會被傳遞給 QGraphicsEffect 的構造函數。

QGraphicsBlurEffect:: ~QGraphicsBlurEffect ()

銷毀效果。

[signal] void QGraphicsBlurEffect:: blurHintsChanged ( BlurHints hints )

This signal is emitted whenever the effect's blur hints changes. The hints parameter holds the effect's new blur hints.

注意: 通知程序信號對於特性 blurHints .

[signal] void QGraphicsBlurEffect:: blurRadiusChanged ( qreal radius )

This signal is emitted whenever the effect's blur radius changes. The radius parameter holds the effect's new blur radius.

注意: 通知程序信號對於特性 blurRadius .

[虛擬] QRectF QGraphicsBlurEffect:: boundingRectFor (const QRectF & rect ) const

重實現自 QGraphicsEffect::boundingRectFor ().

[virtual protected] void QGraphicsBlurEffect:: draw ( QPainter * painter )

重實現自 QGraphicsEffect::draw ().