Subgroup: Geometry
Class: QgsGeometryGeneratorSymbolLayer¶
-
class
qgis.core.
QgsGeometryGeneratorSymbolLayer
¶ Bases:
qgis._core.QgsSymbolLayer
Methods
clone
create
drawPreviewIcon
geometryExpression
Get the expression to generate this geometry. isCompatibleWithSymbol
Will always return true. layerType
properties
render
Will render this symbol layer using the context. setColor
setGeometryExpression
Set the expression to generate this geometry. setSubSymbol
setSymbolType
Set the type of symbol which should be created. startRender
stopRender
subSymbol
symbolType
Access the symbol type. usedAttributes
Signals
Attributes
-
clone
(self) → QgsSymbolLayer¶
-
create
(properties: Dict[str, str]) → QgsSymbolLayer¶
-
drawPreviewIcon
(self, context: QgsSymbolRenderContext, size: QSize)¶
-
geometryExpression
(self) → str¶ Get the expression to generate this geometry.
-
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.
-
layerType
(self) → str¶
-
properties
(self) → Dict[str, str]¶
-
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 – The rendering context which will be used to render and to construct a geometry.
-
setColor
(self, color: Union[QColor, Qt.GlobalColor])¶
-
setGeometryExpression
(self, exp: str)¶ Set the expression to generate this geometry.
-
setSubSymbol
(self, symbol: QgsSymbol) → bool¶
-
setSymbolType
(self, symbolType: QgsSymbol.SymbolType)¶ Set the type of symbol which should be created. Should match with the return type of the expression.
Parameters: symbolType – The symbol type which shall be used below this symbol.
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
stopRender
(self, context: QgsSymbolRenderContext)¶
-
subSymbol
(self) → QgsSymbol¶
-
symbolType
(self) → QgsSymbol.SymbolType¶ Access the symbol type. This defines the type of geometry that is created by this generator.
Returns: Symbol type
-
usedAttributes
(self, context: QgsRenderContext) → Set[str]¶
-