Class: QgsNumericFormatWidget

Base class for widgets which allow control over the properties of QgsNumericFormat subclasses.

Added in version 3.12.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: format(), setFormat()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsNumericFormatWidget

Base classes

QgsPanelWidget

Base class for any widget that can be shown as an inline panel.

QWidget

QObject

QPaintDevice

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

Subclasses

QgsBasicNumericFormatWidget

A widget which allows control over the properties of a QgsBasicNumericFormat.

QgsBearingNumericFormatWidget

A widget which allows control over the properties of a QgsBearingNumericFormat.

QgsCurrencyNumericFormatWidget

A widget which allows control over the properties of a QgsCurrencyNumericFormat.

QgsExpressionBasedNumericFormatWidget

A widget which allows control over the properties of a QgsExpressionBasedNumericFormat.

QgsFractionNumericFormatWidget

A widget which allows control over the properties of a QgsFractionNumericFormat.

QgsGeographicCoordinateNumericFormatWidget

A widget which allows control over the properties of a QgsGeographicCoordinateNumericFormat.

QgsPercentageNumericFormatWidget

A widget which allows control over the properties of a QgsPercentageNumericFormat.

QgsScientificNumericFormatWidget

A widget which allows control over the properties of a QgsScientificNumericFormat.

Abstract Methods

format

Returns the format defined by the current settings in the widget.

setFormat

Sets the format to show in the widget.

Methods

registerExpressionContextGenerator

Register an expression context generator class that will be used to retrieve an expression context for the widget when required.

Signals

changed

Emitted whenever the configuration of the numeric format is changed.

class qgis.gui.QgsNumericFormatWidget[source]

Bases: QgsPanelWidget, QgsExpressionContextGenerator

__init__(parent: QWidget | None = None)

Constructor for QgsNumericFormatWidget.

Parameters:

parent (Optional[QWidget] = None)

signal changed[source]

Emitted whenever the configuration of the numeric format is changed.

abstract format(self) QgsNumericFormat | None[source]

Returns the format defined by the current settings in the widget.

Ownership of the returned object is transferred to the caller

See also

setFormat()

Return type:

Optional[QgsNumericFormat]

registerExpressionContextGenerator(self, generator: QgsExpressionContextGenerator | None)[source]

Register an expression context generator class that will be used to retrieve an expression context for the widget when required.

Added in version 3.40.

Parameters:

generator (Optional[QgsExpressionContextGenerator])

abstract setFormat(self, format: QgsNumericFormat | None)[source]

Sets the format to show in the widget. Ownership is not transferred.

See also

format()

Parameters:

format (Optional[QgsNumericFormat])