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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

fieldFormatterRemoved

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

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

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

fieldFormatterRemoved

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

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)