The QGraphicsDropShadowEffect class provides a drop shadow effect. 更多...
| 頭: | #include <QGraphicsDropShadowEffect> |
| qmake: | QT += widgets |
| Since: | Qt 4.6 |
| 繼承: | QGraphicsEffect |
|
| QGraphicsDropShadowEffect (QObject * parent = Q_NULLPTR) | |
| ~QGraphicsDropShadowEffect () | |
| qreal | blurRadius () const |
| QColor | color () const |
| QPointF | offset () const |
| qreal | xOffset () const |
| qreal | yOffset () const |
| virtual QRectF | boundingRectFor (const QRectF & rect ) const |
| void | setBlurRadius (qreal blurRadius ) |
| void | setColor (const QColor & color ) |
| void | setOffset (const QPointF & ofs ) |
| void | setOffset (qreal dx , qreal dy ) |
| void | setOffset (qreal d ) |
| void | setXOffset (qreal dx ) |
| void | setYOffset (qreal dy ) |
| void | blurRadiusChanged (qreal blurRadius ) |
| void | colorChanged (const QColor & color ) |
| void | offsetChanged (const QPointF & offset ) |
| virtual void | draw (QPainter * painter ) |
The QGraphicsDropShadowEffect class provides a drop shadow effect.
投影效果按投影渲染源。修改投影的顔色可以使用 setColor () function. The drop shadow offset can be modified using the setOffset () function and the blur radius of the drop shadow can be changed with the setBlurRadius () 函數。
By default, the drop shadow is a semi-transparent dark gray ( QColor (63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset of 8 pixels towards the lower right. The drop shadow offset is specified in device coordinates.
另請參閱 QGraphicsBlurEffect , QGraphicsColorizeEffect ,和 QGraphicsOpacityEffect .
This property holds the blur radius in pixels of the drop shadow.
Using a smaller radius results in a sharper shadow, whereas using a bigger radius results in a more blurred shadow.
By default, the blur radius is 1 pixel.
訪問函數:
| qreal | blurRadius () const |
| void | setBlurRadius (qreal blurRadius ) |
通知程序信號:
| void | blurRadiusChanged (qreal blurRadius ) |
This property holds the color of the drop shadow.
By default, the drop color is a semi-transparent dark gray ( QColor (63, 63, 63, 180)).
訪問函數:
| QColor | color () const |
| void | setColor (const QColor & color ) |
通知程序信號:
| void | colorChanged (const QColor & color ) |
另請參閱 offset () 和 blurRadius ().
This property holds the shadow offset in pixels.
By default, the offset is 8 pixels towards the lower right.
The offset is given in device coordinates, which means it is unaffected by scale.
訪問函數:
| QPointF | offset () const |
| void | setOffset (const QPointF & ofs ) |
| void | setOffset (qreal dx , qreal dy ) |
| void | setOffset (qreal d ) |
通知程序信號:
| void | offsetChanged (const QPointF & offset ) |
另請參閱 xOffset (), yOffset (), blurRadius (),和 color ().
This property holds the horizontal shadow offset in pixels.
By default, the horizontal shadow offset is 8 pixels.
訪問函數:
| qreal | xOffset () const |
| void | setXOffset (qreal dx ) |
通知程序信號:
| void | offsetChanged (const QPointF & offset ) |
This property holds the vertical shadow offset in pixels.
By default, the vertical shadow offset is 8 pixels.
訪問函數:
| qreal | yOffset () const |
| void | setYOffset (qreal dy ) |
通知程序信號:
| void | offsetChanged (const QPointF & offset ) |
構造新的 QGraphicsDropShadowEffect instance. The parent 參數會被傳遞給 QGraphicsEffect 的構造函數。
銷毀效果。
[signal]
void
QGraphicsDropShadowEffect::
blurRadiusChanged
(
qreal
blurRadius
)
This signal is emitted whenever the effect's blur radius changes. The blurRadius parameter holds the effect's new blur radius.
注意: 通知程序信號對於特性 blurRadius .
[虛擬]
QRectF
QGraphicsDropShadowEffect::
boundingRectFor
(const
QRectF
&
rect
) const
重實現自 QGraphicsEffect::boundingRectFor ().
[signal]
void
QGraphicsDropShadowEffect::
colorChanged
(const
QColor
&
color
)
此信號發射,每當效果顔色改變時。 color 參數保持效果的新顔色。
注意: 通知程序信號對於特性 color .
[virtual protected]
void
QGraphicsDropShadowEffect::
draw
(
QPainter
*
painter
)
重實現自 QGraphicsEffect::draw ().
[signal]
void
QGraphicsDropShadowEffect::
offsetChanged
(const
QPointF
&
offset
)
This signal is emitted whenever the effect's shadow offset changes. The offset parameter holds the effect's new shadow offset.
注意: 通知程序信號對於特性 offset 。通知程序信號對於特性 xOffset 。通知程序信號對於特性 yOffset .