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.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: createSymbolLayer()
Class Hierarchy¶
Subclasses¶
Convenience metadata class that uses static functions to create symbol layer and its widget. |
Abstract Methods
Create a symbol layer of this type given the map of properties. |
Methods
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsSymbolLayerAbstractMetadata. See the FAQ for more details.
Create a symbol layer of this type given the map of properties. |
|
Create widget for symbol layer of this type. |
|
Resolve fonts from the symbol layer's properties. |
|
Resolve paths in symbol layer's properties (if there are any paths). |
- 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:
- abstract 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]
- virtual 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]
- virtual 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]
- virtual 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 thecontext
if not.Added in version 3.20.
- Parameters:
properties (Dict[str, Any])
context (QgsReadWriteContext)
- virtual 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 isFalse
, 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, Any])
pathResolver (QgsPathResolver)
saving (bool)
- type(self) Qgis.SymbolType [source]¶
- Return type: