The QGraphicsBlurEffect class provides a blur effect. 更多...
头: | #include <QGraphicsBlurEffect> |
qmake: | QT += widgets |
Since: | Qt 4.6 |
继承: | QGraphicsEffect |
该类在 Qt 4.6 引入。
enum | BlurHint { PerformanceHint, QualityHint, AnimationHint } |
flags | BlurHints |
QGraphicsBlurEffect (QObject * parent = nullptr) | |
virtual | ~QGraphicsBlurEffect () |
QGraphicsBlurEffect::BlurHints | blurHints () const |
qreal | blurRadius () const |
virtual QRectF | boundingRectFor (const QRectF & rect ) const override |
void | setBlurHints (QGraphicsBlurEffect::BlurHints hints ) |
void | setBlurRadius (qreal blurRadius ) |
void | blurHintsChanged (QGraphicsBlurEffect::BlurHints hints ) |
void | blurRadiusChanged (qreal radius ) |
virtual void | draw (QPainter * painter ) override |
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 .
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 versions 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 ().
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 .
访问函数:
QGraphicsBlurEffect::BlurHints | blurHints () const |
void | setBlurHints (QGraphicsBlurEffect::BlurHints hints ) |
通知程序信号:
void | blurHintsChanged (QGraphicsBlurEffect::BlurHints hints ) |
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 ) |
Constructs a new QGraphicsBlurEffect instance. The parent 参数会被传递给 QGraphicsEffect 的构造函数。
[signal]
void
QGraphicsBlurEffect::
blurHintsChanged
(
QGraphicsBlurEffect::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 .
[虚拟]
QGraphicsBlurEffect::
~QGraphicsBlurEffect
()
销毁效果。
[override virtual]
QRectF
QGraphicsBlurEffect::
boundingRectFor
(const
QRectF
&
rect
) const
重实现: QGraphicsEffect::boundingRectFor (const QRectF &rect) const.
[override virtual protected]
void
QGraphicsBlurEffect::
draw
(
QPainter
*
painter
)
重实现: QGraphicsEffect::draw (QPainter *painter).