Class: QgsSymbolLayerAbstractMetadata

Stores metadata about one symbol layer class.

Note

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

Class Hierarchy

Inheritance diagram of qgis.core.QgsSymbolLayerAbstractMetadata

Subclasses

QgsSymbolLayerMetadata

Convenience metadata class that uses static functions to create symbol layer and its widget.

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

resolveFonts

Resolve fonts from the symbol layer's properties.

resolvePaths

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

type

visibleName

class qgis.core.QgsSymbolLayerAbstractMetadata[source]

Bases: object

__init__(name: str | None, visibleName: str | None, type: Qgis.SymbolType)

Constructor for QgsSymbolLayerAbstractMetadata.

Parameters:
  • name (Optional[str]) – internal symbol layer name (unique identifier)

  • visibleName (Optional[str]) – user visible, translated name for symbol layer

  • type (Qgis.SymbolType) – associated symbol type

__init__(a0: QgsSymbolLayerAbstractMetadata)
Parameters:

a0 (QgsSymbolLayerAbstractMetadata)

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

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

Parameters:

map (Dict[str, Any])

Return type:

Optional[QgsSymbolLayer]

createSymbolLayerFromSld(self, a0: QDomElement) QgsSymbolLayer | None[source]

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

Parameters:

a0 (QDomElement)

Return type:

Optional[QgsSymbolLayer]

createSymbolLayerWidget(self, a0: QgsVectorLayer | None) QgsSymbolLayerWidget | None[source]

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

Parameters:

a0 (Optional[QgsVectorLayer])

Return type:

Optional[QgsSymbolLayerWidget]

name(self) str[source]
Return type:

str

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

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.

Added in version 3.20.

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

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:
type(self) Qgis.SymbolType[source]
Return type:

Qgis.SymbolType

visibleName(self) str[source]
Return type:

str