Class: QgsSymbolLayerRegistry

class qgis.core.QgsSymbolLayerRegistry

Bases: sip.wrapper

Registry of available symbol layer classes.

QgsSymbolLayerRegistry is not usually directly created, but rather accessed through QgsApplication.symbolLayerRegistry()

Methods

addSymbolLayerType

register a new symbol layer type.

createSymbolLayer

create a new instance of symbol layer given symbol layer name and properties

createSymbolLayerFromSld

create a new instance of symbol layer given symbol layer name and SLD

defaultSymbolLayer

create a new instance of symbol layer for specified symbol type with default settings

resolvePaths

Resolve paths in properties of a particular symbol layer.

symbolLayerMetadata

Returns metadata for specified symbol layer.

symbolLayersForType

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

QgsSymbolLayer

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

QgsSymbolLayer

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

QgsSymbolLayer

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

QgsSymbolLayerAbstractMetadata

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]