QGraphicsOpacityEffect ClassThe QGraphicsOpacityEffect class provides an opacity effect. More... #include <QGraphicsOpacityEffect> Inherits: QGraphicsEffect. This class was introduced in Qt 4.6. Public Types
Properties
Public Functions
Public Slots
Signals
Protected Functions
Reimplemented Protected Functions
Additional Inherited Members
Detailed DescriptionThe QGraphicsOpacityEffect class provides an opacity effect. An opacity effect renders the source with an opacity. This effect is useful for making the source semi-transparent, similar to a fade-in/fade-out sequence. The opacity can be modified using the setOpacity() function. By default, the opacity is 0.7. See also QGraphicsDropShadowEffect, QGraphicsBlurEffect, and QGraphicsColorizeEffect. Property Documentation
|
qreal | opacity() const |
void | setOpacity(qreal opacity) |
Notifier signal:
void | opacityChanged(qreal opacity) |
See also setOpacityMask().
This property holds the opacity mask of the effect.
An opacity mask allows you apply opacity to portions of an element.
For example:
... QLinearGradient alphaGradient(rect.topLeft(), rect.bottomLeft()); alphaGradient.setColorAt(0.0, Qt::transparent); alphaGradient.setColorAt(0.5, Qt::black); alphaGradient.setColorAt(1.0, Qt::transparent); QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect; effect->setOpacityMask(alphaGradient); ...
There is no opacity mask by default.
Access functions:
QBrush | opacityMask() const |
void | setOpacityMask(const QBrush & mask) |
Notifier signal:
void | opacityMaskChanged(const QBrush & mask) |
See also setOpacity().
Constructs a new QGraphicsOpacityEffect instance. The parent parameter is passed to QGraphicsEffect's constructor.
Destroys the effect.
Reimplemented from QGraphicsEffect::draw().