Class: QgsRendererRegistry

class qgis.core.QgsRendererRegistry

Bases: sip.wrapper

Registry of renderers.

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

Enums

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.

Signals

Attributes

addRenderer(self, metadata: QgsRendererAbstractMetadata) → bool

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

Parameters:metadata – renderer metadata
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 – name of renderer to remove from registry
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.

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

Returns a list of available renderers.

Parameters: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.