QGraphicsColorizeEffect Class

The QGraphicsColorizeEffect class provides a colorize effect. 更多...

头文件: #include <QGraphicsColorizeEffect>
qmake: QT += widgets
开始支持版本: Qt 4.6
基类: QGraphicsEffect

属性

公有函数

QGraphicsColorizeEffect(QObject *parent = Q_NULLPTR)
~QGraphicsColorizeEffect()
QColor color() const
qreal strength() const

公有槽函数

void setColor(const QColor &c)
void setStrength(qreal strength)

信号

void colorChanged(const QColor &color)
void strengthChanged(qreal strength)

重新实现的受保护函数

virtual void draw(QPainter *painter)

其他继承的成员

详细描述

The QGraphicsColorizeEffect class provides a colorize effect.

A colorize effect renders the source with a tint of its color(). The color can be modified using the setColor() function.

By default, the color is light blue (QColor(0, 0, 192)).

参见 QGraphicsDropShadowEffect, QGraphicsBlurEffect, and QGraphicsOpacityEffect.

属性

color : QColor

This property holds the color of the effect.

By default, the color is light blue (QColor(0, 0, 192)).

访问函数:

QColor color() const
void setColor(const QColor &c)

Notifier signal:

void colorChanged(const QColor &color)

strength : qreal

This property holds the strength of the effect.

By default, the strength is 1.0. A strength 0.0 equals to no effect, while 1.0 means full colorization.

访问函数:

qreal strength() const
void setStrength(qreal strength)

Notifier signal:

void strengthChanged(qreal strength)

成员函数

QGraphicsColorizeEffect::QGraphicsColorizeEffect(QObject *parent = Q_NULLPTR)

Constructs a new QGraphicsColorizeEffect instance. The parent parameter is passed to QGraphicsEffect's constructor.

QGraphicsColorizeEffect::~QGraphicsColorizeEffect()

Destroys the effect.

[signal] void QGraphicsColorizeEffect::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 QGraphicsColorizeEffect::draw(QPainter *painter)

重新实现 QGraphicsEffect::draw().

[signal] void QGraphicsColorizeEffect::strengthChanged(qreal strength)

This signal is emitted whenever setStrength() changes the colorize strength property. strength contains the new strength value of the colorize effect.

Note: Notifier signal for property strength.