Class: QgsScaleBarRendererRegistry¶
A registry which manages registered scalebar renderers.
A reference to the QgsScaleBarRendererRegistry
can be
obtained from QgsApplication.scalebarRendererRegistry()
.
Added in version 3.14.
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. |
- class qgis.core.QgsScaleBarRendererRegistry[source]¶
Bases:
object
- __init__()
You should not normally need to create your own scalebar renderer registry.
Use the one provided by :py:func:`QgsApplication.scalebarRendererRegistry()` instead.
- __init__(a0: QgsScaleBarRendererRegistry)
- Parameters:
- addRenderer(self, renderer: QgsScaleBarRenderer | None)[source]¶
Adds a new
renderer
to the registry.Ownership is transferred to the registry.
- Parameters:
renderer (Optional[QgsScaleBarRenderer])
- removeRenderer(self, id: str | None)[source]¶
Removes the renderer with matching
id
from the registry.- Parameters:
id (Optional[str])
- renderer(self, id: str | None) QgsScaleBarRenderer | None [source]¶
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 (Optional[str])
- Return type:
Optional[QgsScaleBarRenderer]
- renderers(self) List[str] [source]¶
Returns a list of the renderer ids currently contained in the registry.
- Return type:
List[str]
- sortKey(self, id: str | None) int [source]¶
Returns the sorting key for the renderer with matching
id
.- Parameters:
id (Optional[str])
- Return type:
int