Class: QgsSymbolLayerAbstractMetadata

class qgis.core.QgsSymbolLayerAbstractMetadata

Bases: sip.wrapper

Stores metadata about one symbol layer class.

Note

It’s necessary to implement createSymbolLayer() function. In C++ you can use QgsSymbolLayerMetadata convenience class.

QgsSymbolLayerAbstractMetadata(name: str, visibleName: str, type: Qgis.SymbolType) Constructor for QgsSymbolLayerAbstractMetadata.

Parameters:
  • name – internal symbol layer name (unique identifier)

  • visibleName – user visible, translated name for symbol layer

  • type – associated symbol type

QgsSymbolLayerAbstractMetadata(QgsSymbolLayerAbstractMetadata)

Methods

createSymbolLayer

Create a symbol layer of this type given the map of properties.

createSymbolLayerFromSld

Create a symbol layer of this type given the map of properties.

createSymbolLayerWidget

Create widget for symbol layer of this type.

name

rtype:

str

resolveFonts

Resolve fonts from the symbol layer's properties.

resolvePaths

Resolve paths in symbol layer's properties (if there are any paths).

type

rtype:

Qgis.SymbolType

visibleName

rtype:

str

createSymbolLayer(self, map: Dict[str, Any]) QgsSymbolLayer

Create a symbol layer of this type given the map of properties.

Parameters:

map (Dict[str) –

Return type:

QgsSymbolLayer

createSymbolLayerFromSld(self, QDomElement) QgsSymbolLayer

Create a symbol layer of this type given the map of properties.

Return type:

QgsSymbolLayer

createSymbolLayerWidget(self, QgsVectorLayer) QgsSymbolLayerWidget

Create widget for symbol layer of this type. Can return None if there’s no GUI

Return type:

QgsSymbolLayerWidget

name(self) str
Return type:

str

resolveFonts(self, properties: Dict[str, Any], context: QgsReadWriteContext)

Resolve fonts from the symbol layer’s properties.

This tests whether the required fonts from the encoded properties are available on the system, and records warnings in the context if not.

New in version 3.20.

Parameters:
resolvePaths(self, properties: Dict[str, Any], pathResolver: QgsPathResolver, saving: bool)

Resolve paths in symbol layer’s properties (if there are any paths). When saving is True, paths are converted from absolute to relative, when saving is False, paths are converted from relative to absolute. This ensures that paths in project files can be relative, but in symbol layer instances the paths are always absolute

Parameters:
  • properties (Dict[str) –

  • pathResolver (QgsPathResolver) –

  • saving (bool) –

type(self) Qgis.SymbolType
Return type:

Qgis.SymbolType

visibleName(self) str
Return type:

str