Class: QgsGeometryGeneratorSymbolLayer¶
- class qgis.core.QgsGeometryGeneratorSymbolLayer¶
Bases:
QgsSymbolLayer
Methods
- rtype
QgsSymbolLayer
Creates the symbol layer
- param context
Gets the expression to generate this geometry.
- rtype
bool
Will always return
True
.- rtype
str
- rtype
Dict[str, Any]
Will render this symbol layer using the context.
- param color
Set the expression to generate this geometry.
- param symbol
Set the type of symbol which should be created.
- param feature
- param context
- param feature
- param context
- rtype
QgsSymbol
Access the symbol type.
- param context
- rtype
bool
- clone(self) QgsSymbolLayer ¶
- Return type
- create(properties: Dict[str, Any]) QgsSymbolLayer ¶
Creates the symbol layer
- Parameters
properties (Dict[str) –
- Return type
- drawPreviewIcon(self, context: QgsSymbolRenderContext, size: QSize)¶
- Parameters
context (QgsSymbolRenderContext) –
size (QSize) –
- geometryExpression(self) str ¶
Gets the expression to generate this geometry.
- Return type
str
- hasDataDefinedProperties(self) bool ¶
- Return type
bool
- isCompatibleWithSymbol(self, symbol: QgsSymbol) bool ¶
Will always return
True
. This is a hybrid layer, it constructs its own geometry so it does not care about the geometry of its parents.- Parameters
symbol (QgsSymbol) –
- Return type
bool
- layerType(self) str ¶
- Return type
str
- properties(self) Dict[str, Any] ¶
- Return type
Dict[str, Any]
- render(self, context: QgsSymbolRenderContext)¶
Will render this symbol layer using the context. In comparison to other symbols there is no geometry passed in, since the geometry will be created based on information from the context which contains a
QgsRenderContext
which in turn contains an expression context which is available to the evaluated expression.- Parameters
context (QgsSymbolRenderContext) – The rendering context which will be used to render and to construct a geometry.
- setColor(self, color: Union[QColor, Qt.GlobalColor])¶
- Parameters
color (Union[QColor) –
- setGeometryExpression(self, exp: str)¶
Set the expression to generate this geometry.
- Parameters
exp (str) –
- setSymbolType(self, symbolType: Qgis.SymbolType)¶
Set the type of symbol which should be created. Should match with the return type of the expression.
- Parameters
symbolType (Qgis.SymbolType) – The symbol type which shall be used below this symbol.
- startFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)¶
- Parameters
feature (QgsFeature) –
context (QgsRenderContext) –
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- stopFeatureRender(self, feature: QgsFeature, context: QgsRenderContext)¶
- Parameters
feature (QgsFeature) –
context (QgsRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters
context (QgsSymbolRenderContext) –
- symbolType(self) Qgis.SymbolType ¶
Access the symbol type. This defines the type of geometry that is created by this generator.
- Return type
- Returns
Symbol type
- usedAttributes(self, context: QgsRenderContext) Set[str] ¶
- Parameters
context (QgsRenderContext) –
- Return type
Set[str]
- usesMapUnits(self) bool ¶
- Return type
bool