Class: QgsScaleBarRendererRegistry¶
- class qgis.core.QgsScaleBarRendererRegistry¶
Bases:
sip.wrapper
The
QgsScaleBarRendererRegistry
manages registered scalebar renderers.A reference to the
QgsScaleBarRendererRegistry
can be obtained fromQgsApplication.scalebarRendererRegistry()
.New in version 3.14.
QgsScaleBarRendererRegistry() You should not normally need to create your own scalebar renderer registry.
Use the one provided by :py:func:`QgsApplication.scalebarRendererRegistry()` instead.
QgsScaleBarRendererRegistry(
QgsScaleBarRendererRegistry
)Methods
Adds a new
renderer
to the registry.Removes the renderer with matching
id
from the registry.Creates a new scalebar renderer by
id
.Returns a list of the renderer ids currently contained in the registry.
Returns the sorting key for the renderer with matching
id
.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.
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 suchid
registered,None
will be returned instead.The caller takes ownership of the returned object.
- Parameters:
id (str) –
- Return type:
- 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