QGraphicsOpacityEffect#
The QGraphicsOpacityEffect
class provides an opacity effect. More…
New in version 4.6.
Synopsis#
Properties#
opacity
- The opacity of the effectopacityMask
- The opacity mask of the effect
Functions#
def
opacity
()def
opacityMask
()
Slots#
def
setOpacity
(opacity)def
setOpacityMask
(mask)
Signals#
def
opacityChanged
(opacity)def
opacityMaskChanged
(mask)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
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.
- class PySide6.QtWidgets.QGraphicsOpacityEffect([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Constructs a new QGraphicsOpacityEffect
instance. The parent
parameter is passed to QGraphicsEffect
‘s constructor.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtWidgets.QGraphicsOpacityEffect.opacity: float#
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.
See also
- Access functions:
opacity
()setOpacity
(opacity)Signal
opacityChanged
(opacity)
- property PᅟySide6.QtWidgets.QGraphicsOpacityEffect.opacityMask: PySide6.QtGui.QBrush#
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
This property holds the opacity mask of the effect..
An opacity mask allows you apply opacity to portions of an element.
For example:
... alphaGradient = QLinearGradient(rect.topLeft(), rect.bottomLeft()) alphaGradient.setColorAt(0.0, Qt.transparent) alphaGradient.setColorAt(0.5, Qt.black) alphaGradient.setColorAt(1.0, Qt.transparent) effect = QGraphicsOpacityEffect() effect.setOpacityMask(alphaGradient) ...
There is no opacity mask by default.
See also
- Access functions:
opacityMask
()setOpacityMask
(mask)Signal
opacityMaskChanged
(mask)
- PySide6.QtWidgets.QGraphicsOpacityEffect.opacity()#
- Return type:
float
See also
Getter of property opacity
.
- PySide6.QtWidgets.QGraphicsOpacityEffect.opacityChanged(opacity)#
- Parameters:
opacity – float
This signal is emitted whenever the effect’s opacity changes. The opacity
parameter holds the effect’s new opacity.
Notification signal of property opacity
.
- PySide6.QtWidgets.QGraphicsOpacityEffect.opacityMask()#
- Return type:
See also
Getter of property opacityMask
.
- PySide6.QtWidgets.QGraphicsOpacityEffect.opacityMaskChanged(mask)#
- Parameters:
mask –
PySide6.QtGui.QBrush
This signal is emitted whenever the effect’s opacity mask changes. The mask
parameter holds the effect’s new opacity mask.
Notification signal of property opacityMask
.
- PySide6.QtWidgets.QGraphicsOpacityEffect.setOpacity(opacity)#
- Parameters:
opacity – float
See also
Setter of property opacity
.
- PySide6.QtWidgets.QGraphicsOpacityEffect.setOpacityMask(mask)#
- Parameters:
mask –
PySide6.QtGui.QBrush
See also
Setter of property opacityMask
.