Class: QgsScaleBarRendererRegistry

class qgis.core.QgsScaleBarRendererRegistry

Bases: sip.wrapper

You should not normally need to create your own scalebar renderer registry.

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

QgsScaleBarRendererRegistry(QgsScaleBarRendererRegistry)

The QgsScaleBarRendererRegistry manages registered scalebar renderers.

A reference to the QgsScaleBarRendererRegistry can be obtained from QgsApplication.scalebarRendererRegistry().

Methods

addRenderer

Adds a new renderer to the registry.

removeRenderer

Removes the renderer with matching id from the registry.

renderer

Creates a new scalebar renderer by id.

renderers

Returns a list of the renderer ids currently contained in the registry.

sortKey

Returns the sorting key for the renderer with matching id.

sortedRendererList

Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting the renderer’s sort keys and display strings.

visibleName

Returns the translated, user-visible name for the renderer with matching id.

addRenderer(self, renderer: QgsScaleBarRenderer)

Adds a new renderer to the registry.

Ownership is transferred to the registry.

Parameters

renderer (QgsScaleBarRenderer) –

removeRenderer(self, id: str)

Removes the renderer with matching id from the registry.

Parameters

id (str) –

renderer(self, id: str)QgsScaleBarRenderer

Creates a new scalebar renderer by id. If there is no such id registered, None will be returned instead.

The caller takes ownership of the returned object.

Parameters

id (str) –

Return type

QgsScaleBarRenderer

renderers(self)List[str]

Returns a list of the renderer ids currently contained in the registry.

Return type

List[str]

sortKey(self, id: str)int

Returns the sorting key for the renderer with matching id.

Parameters

id (str) –

Return type

int

sortedRendererList(self)List[str]

Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting the renderer’s sort keys and display strings.

Return type

List[str]

visibleName(self, id: str)str

Returns the translated, user-visible name for the renderer with matching id.

Parameters

id (str) –

Return type

str