Class: QgsFieldFormatterRegistry

class qgis.core.QgsFieldFormatterRegistry

Bases: PyQt5.QtCore.QObject

The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter.

A reference to the QgsFieldFormatterRegistry can be obtained from QgsApplication.fieldFormatterRegistry().

New in version 3.0.

QgsFieldFormatterRegistry(parent: QObject = None) You should not normally need to create your own field formatter registry.

Use the one provided by :py:func:`QgsApplication.fieldFormatterRegistry()` instead.

Methods

addFieldFormatter

They will take precedence in order of adding them.

childEvent

connectNotify

customEvent

disconnectNotify

fallbackFieldFormatter

Returns a basic fallback field formatter which can be used to represent any field in an unspectacular manner.

fieldFormatter

Gets a field formatter by its id.

isSignalConnected

receivers

removeFieldFormatter

Remove a field formatter from the registry.

sender

senderSignalIndex

timerEvent

Signals

fieldFormatterAdded

Will be emitted after a new field formatter has been added.

fieldFormatterRemoved

Will be emitted just before a field formatter is removed and deleted.

addFieldFormatter(self, formatter: QgsFieldFormatter)

They will take precedence in order of adding them. The later they are added, the more weight they have.

Ownership is transferred to the registry.

Parameters

formatter (QgsFieldFormatter) –

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
fallbackFieldFormatter(self)QgsFieldFormatter

Returns a basic fallback field formatter which can be used to represent any field in an unspectacular manner.

Return type

QgsFieldFormatter

fieldFormatter(self, id: str)QgsFieldFormatter

Gets a field formatter by its id. If there is no such id registered, a default QgsFallbackFieldFormatter with a null id will be returned instead.

Parameters

id (str) –

Return type

QgsFieldFormatter

fieldFormatterAdded

Will be emitted after a new field formatter has been added. [signal]

Parameters

formatter (QgsFieldFormatter) –

fieldFormatterRemoved

Will be emitted just before a field formatter is removed and deleted. [signal]

Parameters

formatter (QgsFieldFormatter) –

isSignalConnected(self, QMetaMethod)bool
receivers(self, PYQT_SIGNAL)int
removeFieldFormatter(self, formatter: QgsFieldFormatter)

Remove a field formatter from the registry. The field formatter will be deleted.

removeFieldFormatter(self, id: str) Remove the field formatter with the specified id.

Parameters

formatter (QgsFieldFormatter) –

sender(self)QObject
senderSignalIndex(self)int
timerEvent(self, QTimerEvent)