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
register 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
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 ¶
register a new symbol layer type. Takes ownership of the metadata instance.
- Parameters
metadata (QgsSymbolLayerAbstractMetadata) –
- Return type
bool
- createSymbolLayer(self, name: str, properties: Dict[str, str] = {}) 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: QgsSymbol.SymbolType) QgsSymbolLayer ¶
create a new instance of symbol layer for specified symbol type with default settings
- Parameters
type (QgsSymbol.SymbolType) –
- Return type
- resolvePaths(self, name: str, properties: Dict[str, str], 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: QgsSymbol.SymbolType) List[str] ¶
Returns a list of available symbol layers for a specified symbol type
- Parameters
type (QgsSymbol.SymbolType) –
- Return type
List[str]