QGraphicsColorizeEffect Class | Qt Widgets 5.6

Qt 5.6 | Qt Widgets | C++ Classes | QGraphicsColorizeEffect

Qt 5.6.2 Reference Documentation

# QGraphicsColorizeEffect Class

The QGraphicsColorizeEffect class provides a colorize effect. More...

Header: | #include <QGraphicsColorizeEffect>
qmake: | QT += widgets
Since: | Qt 4.6
Inherits: | QGraphicsEffect

- List of all members, including inherited members

## Properties

- color : QColor
- strength : qreal

- 1 property inherited from QGraphicsEffect

## Public Functions

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

- 3 public functions inherited from QGraphicsEffect

## Public Slots

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

- 2 public slots inherited from QGraphicsEffect

## Signals

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

- 1 signal inherited from QGraphicsEffect

## Reimplemented Protected Functions

virtual void | draw(QPainter *painter)

- 7 protected functions inherited from QGraphicsEffect

## Detailed Description

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)).

See also QGraphicsDropShadowEffect, QGraphicsBlurEffect, and QGraphicsOpacityEffect.

## Property Documentation

### color : QColor

This property holds the color of the effect.

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

Access functions:

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.

Access functions:

qreal | strength() const
void | setStrength(qreal strength)

Notifier signal:

void | strengthChanged(qreal strength)

## Member Function Documentation

### 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)

Reimplemented from 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.