Class: QgsOpacityWidget

A widget for setting an opacity value.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOpacityWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

opacity

Returns the current opacity selected in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

setOpacity

Sets the current opacity to show in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

Signals

opacityChanged

Emitted when the opacity is changed in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

class qgis.gui.QgsOpacityWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsOpacityWidget.

Parameters:

parent (Optional[QWidget] = None)

opacity(self) float[source]

Returns the current opacity selected in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

See also

setOpacity()

See also

opacityChanged()

Return type:

float

signal opacityChanged(opacity: float)[source]

Emitted when the opacity is changed in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

See also

setOpacity()

See also

opacity()

Parameters:

opacity (float)

setOpacity(self, opacity: float)[source]

Sets the current opacity to show in the widget, where opacity ranges from 0.0 (transparent) to 1.0 (opaque).

See also

opacity()

See also

opacityChanged()

Parameters:

opacity (float)