Class: QgsSymbolLayerRegistry¶
- class qgis.core.QgsSymbolLayerRegistry¶
Bases:
sip.wrapper
Registry of available symbol layer classes.
QgsSymbolLayerRegistry
is not usually directly created, but rather accessed throughQgsApplication.symbolLayerRegistry()
.Methods
Registers a new symbol layer type.
create a new instance of symbol layer given symbol layer name and properties
create a new instance of symbol layer given symbol layer name and SLD
create a new instance of symbol layer for specified symbol type with default settings
Removes a symbol layer type
Resolve fonts from the
properties
of a particular symbol layer.Resolve paths in properties of a particular symbol layer.
Returns metadata for specified symbol layer.
Returns a list of available symbol layers for a specified symbol type
- addSymbolLayerType(self, metadata: QgsSymbolLayerAbstractMetadata) bool ¶
Registers a new symbol layer type. Takes ownership of the metadata instance.
- Parameters
metadata (QgsSymbolLayerAbstractMetadata) –
- Return type
bool
- createSymbolLayer(self, name: str, properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
create a new instance of symbol layer given symbol layer name and properties
- Parameters
name (str) –
properties (Dict[str) –
- Return type
- createSymbolLayerFromSld(self, name: str, element: QDomElement) QgsSymbolLayer ¶
create a new instance of symbol layer given symbol layer name and SLD
- Parameters
name (str) –
element (QDomElement) –
- Return type
- defaultSymbolLayer(type: Qgis.SymbolType) QgsSymbolLayer ¶
create a new instance of symbol layer for specified symbol type with default settings
- Parameters
type (Qgis.SymbolType) –
- Return type
- removeSymbolLayerType(self, metadata: QgsSymbolLayerAbstractMetadata) bool ¶
Removes a symbol layer type
New in version 3.22.2.
- Parameters
metadata (QgsSymbolLayerAbstractMetadata) –
- Return type
bool
- resolveFonts(self, name: str, properties: Dict[str, Any], context: QgsReadWriteContext)¶
Resolve fonts from the
properties
of a particular symbol layer.This tests whether the required fonts from the encoded
properties
are available on the system, and records warnings in thecontext
if not.New in version 3.20.
- Parameters
name (str) –
properties (Dict[str) –
context (QgsReadWriteContext) –
- resolvePaths(self, name: str, properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)¶
Resolve paths in properties of a particular symbol layer. This normally means converting relative paths to absolute paths when loading and converting absolute paths to relative paths when saving.
New in version 3.0.
- Parameters
name (str) –
properties (Dict[str) –
pathResolver (QgsPathResolver) –
saving (bool) –
- symbolLayerMetadata(self, name: str) QgsSymbolLayerAbstractMetadata ¶
Returns metadata for specified symbol layer. Returns
None
if not found- Parameters
name (str) –
- Return type
- symbolLayersForType(self, type: Qgis.SymbolType) List[str] ¶
Returns a list of available symbol layers for a specified symbol type
- Parameters
type (Qgis.SymbolType) –
- Return type
List[str]