QGraphicsDropShadowEffect Class
The QGraphicsDropShadowEffect class provides a drop shadow effect. 更多...
头文件: | #include <QGraphicsDropShadowEffect> |
qmake: | QT += widgets |
开始支持版本: | Qt 4.6 |
基类: | QGraphicsEffect |
属性
|
- 1 个属性继承自 QGraphicsEffect
- 1 个属性继承自 QObject
公有函数
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 |
- 3 个公有函数继承自 QGraphicsEffect
- 32 个公有函数继承自 QObject
公有槽函数
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) |
- 2 个公有槽函数继承自 QGraphicsEffect
- 1 个公有槽函数继承自 QObject
信号
void | blurRadiusChanged(qreal blurRadius) |
void | colorChanged(const QColor &color) |
void | offsetChanged(const QPointF &offset) |
- 1 个信号继承自 QGraphicsEffect
- 2 个信号继承自 QObject
重新实现的受保护函数
virtual void | draw(QPainter *painter) |
- 7 个受保护的函数继承自 QGraphicsEffect
- 9 个受保护的函数继承自 QObject
其他继承的成员
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 7 个受保护的函数继承自 QGraphicsEffect
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
The QGraphicsDropShadowEffect class provides a drop shadow effect.
A drop shadow effect renders the source with a drop shadow. The color of the drop shadow can be modified using the 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() function.
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, and QGraphicsOpacityEffect.
属性
blurRadius : qreal
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) |
Notifier signal:
void | blurRadiusChanged(qreal blurRadius) |
color : QColor
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) |
Notifier signal:
void | colorChanged(const QColor &color) |
参见 offset() and blurRadius().
offset : QPointF
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) |
Notifier signal:
void | offsetChanged(const QPointF &offset) |
参见 xOffset(), yOffset(), blurRadius(), and color().
xOffset : qreal
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) |
Notifier signal:
void | offsetChanged(const QPointF &offset) |
yOffset : qreal
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) |
Notifier signal:
void | offsetChanged(const QPointF &offset) |
成员函数
QGraphicsDropShadowEffect::QGraphicsDropShadowEffect(QObject *parent = Q_NULLPTR)
Constructs a new QGraphicsDropShadowEffect instance. The parent parameter is passed to QGraphicsEffect's constructor.
QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()
Destroys the effect.
[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.
Note: Notifier signal for property blurRadius.
[virtual]
QRectF QGraphicsDropShadowEffect::boundingRectFor(const QRectF &rect) const
重新实现 QGraphicsEffect::boundingRectFor().
[signal]
void QGraphicsDropShadowEffect::colorChanged(const QColor &color)
This signal is emitted whenever the effect's color changes. The color parameter holds the effect's new color.
Note: Notifier signal for property 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.
Note: Notifier signal for property offset. Notifier signal for property xOffset. Notifier signal for property yOffset.