Class: QgsPlotRegistry¶
Registry of available plot types.
QgsPlotRegistry
is not usually directly created, but rather
accessed through QgsApplication.plotRegistry()
.
Added in version 4.0.
Class Hierarchy¶
Base classes¶
Methods
Registers a new plot type. |
|
Creates a new instance of a plot given the type. |
|
Returns the metadata for the specified plot type. |
|
Returns a map of available plot types to translated name. |
|
Populates the registry with standard plot types. |
|
Removes a new a plot type from the registry. |
Signals
Emitted whenever a plot type is about to be remove from the registry, with the specified type and visible name. |
|
Emitted whenever a new plot type is added to the registry, with the specified type and visible name. |
- class qgis.core.QgsPlotRegistry[source]¶
Bases:
QObject
- __init__(parent: QObject | None = None)
Creates a new empty plot registry.
QgsPlotRegistry is not usually directly created, but rather accessed through
QgsApplication.plotRegistry()
.See also
- Parameters:
parent (Optional[QObject] = None)
- addPlotType(self, metadata: QgsPlotAbstractMetadata | None) bool [source]¶
Registers a new plot type.
Note
Takes ownership of the metadata instance.
- Parameters:
metadata (Optional[QgsPlotAbstractMetadata])
- Return type:
bool
- createPlot(self, type: str | None) QgsPlot | None [source]¶
Creates a new instance of a plot given the
type
.- Parameters:
type (Optional[str])
- Return type:
Optional[QgsPlot]
- signal plotAboutToBeRemoved(type: str)[source]¶
Emitted whenever a plot type is about to be remove from the registry, with the specified
type
and visiblename
.- Parameters:
type (str)
- signal plotAdded(type: str, name: str)[source]¶
Emitted whenever a new plot type is added to the registry, with the specified
type
and visiblename
.- Parameters:
type (str)
name (str)
- plotMetadata(self, type: str | None) QgsPlotAbstractMetadata | None [source]¶
Returns the metadata for the specified plot
type
. ReturnsNone
if a corresponding type was not found in the registry.- Parameters:
type (Optional[str])
- Return type:
Optional[QgsPlotAbstractMetadata]
- plotTypes(self) Dict[str, str] ¶
Returns a map of available plot types to translated name.
- Return type:
Dict[str, str]