Class: QgsRendererRegistry

class qgis.core.QgsRendererRegistry

Bases: sip.wrapper

Registry of renderers.

QgsRendererRegistry is not usually directly created, but rather accessed through QgsApplication.rendererRegistry()

Methods

addRenderer

Adds a renderer to the registry.

removeRenderer

Removes a renderer from registry.

rendererMetadata

Returns the metadata for a specified renderer.

renderersList

Returns a list of available renderers.

addRenderer(self, metadata: QgsRendererAbstractMetadata) → bool

Adds a renderer to the registry. Takes ownership of the metadata object.

Parameters

metadata (QgsRendererAbstractMetadata) – renderer metadata

Return type

bool

Returns

True if renderer was added successfully, or False if renderer could not be added (e.g., a renderer with a duplicate name already exists)

removeRenderer(self, rendererName: str) → bool

Removes a renderer from registry.

Parameters

rendererName (str) – name of renderer to remove from registry

Return type

bool

Returns

True if renderer was successfully removed, or False if matching renderer could not be found

rendererMetadata(self, rendererName: str) → QgsRendererAbstractMetadata

Returns the metadata for a specified renderer. Returns None if a matching renderer was not found in the registry.

Parameters

rendererName (str) –

Return type

QgsRendererAbstractMetadata

renderersList(self, layerTypes: Union[QgsRendererAbstractMetadata.LayerTypes, QgsRendererAbstractMetadata.LayerType] = QgsRendererAbstractMetadata.All) → List[str]

Returns a list of available renderers.

Parameters

layerTypes (Union[QgsRendererAbstractMetadata.LayerTypes) – flags to filter the renderers by compatible layer types

renderersList(self, layer: QgsVectorLayer) -> List[str] Returns a list of available renderers which are compatible with a specified layer.

Parameters

layer – vector layer

New in version 2.16.

Return type

List[str]