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 useQgsSymbolLayerMetadata
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
Create a symbol layer of this type given the map of properties.
Create a symbol layer of this type given the map of properties.
Create widget for symbol layer of this type.
- rtype:
str
Resolve fonts from the symbol layer's
properties
.Resolve paths in symbol layer's properties (if there are any paths).
- rtype:
Qgis.SymbolType
- 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:
- createSymbolLayerFromSld(self, QDomElement) QgsSymbolLayer ¶
Create a symbol layer of this type given the map of properties.
- Return type:
- createSymbolLayerWidget(self, QgsVectorLayer) QgsSymbolLayerWidget ¶
Create widget for symbol layer of this type. Can return
None
if there’s no GUI- Return type:
- 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 thecontext
if not.New in version 3.20.
- Parameters:
properties (Dict[str) –
context (QgsReadWriteContext) –
- 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 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) –
pathResolver (QgsPathResolver) –
saving (bool) –
- type(self) Qgis.SymbolType ¶
- Return type:
- visibleName(self) str ¶
- Return type:
str