Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QGraphicsOpacityEffect Class

TheQGraphicsOpacityEffect class provides an opacity effect.More...

Header:#include <QGraphicsOpacityEffect>
Since: Qt 4.6
Inherits:QGraphicsEffect

Properties

Public Functions

QGraphicsOpacityEffect(QObject * parent = 0)
~QGraphicsOpacityEffect()
qrealopacity() const
QBrushopacityMask() const

Public Slots

voidsetOpacity(qreal opacity)
voidsetOpacityMask(const QBrush & mask)

Signals

voidopacityChanged(qreal opacity)
voidopacityMaskChanged(const QBrush & mask)

Reimplemented Protected Functions

virtual voiddraw(QPainter * painter)

Additional Inherited Members

Detailed Description

TheQGraphicsOpacityEffect 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 thesetOpacity() function.

By default, the opacity is 0.7.

See alsoQGraphicsDropShadowEffect,QGraphicsBlurEffect, andQGraphicsColorizeEffect.

Property Documentation

opacity :qreal

This property holds the opacity of the effect.

The value should be in the range of 0.0 to 1.0, where 0.0 is fully transparent and 1.0 is fully opaque.

By default, the opacity is 0.7.

Access functions:

qrealopacity() const
voidsetOpacity(qreal opacity)

Notifier signal:

voidopacityChanged(qreal opacity)

See alsosetOpacityMask().

opacityMask :QBrush

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=newQGraphicsOpacityEffect;effect->setOpacityMask(alphaGradient);...

There is no opacity mask by default.

Access functions:

QBrushopacityMask() const
voidsetOpacityMask(const QBrush & mask)

Notifier signal:

voidopacityMaskChanged(const QBrush & mask)

See alsosetOpacity().

Member Function Documentation

QGraphicsOpacityEffect::QGraphicsOpacityEffect(QObject * parent = 0)

Constructs a newQGraphicsOpacityEffect instance. Theparent parameter is passed toQGraphicsEffect's constructor.

QGraphicsOpacityEffect::~QGraphicsOpacityEffect()

Destroys the effect.

[virtual protected]void QGraphicsOpacityEffect::draw(QPainter * painter)

Reimplemented fromQGraphicsEffect::draw().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp