Class: QgsPercentageWidget

A widget for setting a percentage value.

Added in version 3.36.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.gui.QgsPercentageWidget

Base classes

QWidget

QObject

QPaintDevice

Constructor

__init__

Methods

setValue

Sets the current value to show in the widget, where value is a factor which ranges from 0.0 to 1.0.

value

Returns the current percentage selected in the widget, as a factor from 0.0 to 1.0.

Signals

valueChanged

Emitted when the value is changed in the widget, where value is a factor which ranges from 0.0 to 1.0.

class qgis.gui.QgsPercentageWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsPercentageWidget.

Parameters:

parent (Optional[QWidget] = None)

setValue(self, value: float)[source]

Sets the current value to show in the widget, where value is a factor which ranges from 0.0 to 1.0.

See also

value()

See also

valueChanged()

Parameters:

value (float)

value(self) float[source]

Returns the current percentage selected in the widget, as a factor from 0.0 to 1.0.

See also

setValue()

See also

valueChanged()

Return type:

float

signal valueChanged(value: float)[source]

Emitted when the value is changed in the widget, where value is a factor which ranges from 0.0 to 1.0.

See also

setValue()

See also

value()

Parameters:

value (float)