Class: QgsGeometryGeneratorSymbolLayer

class qgis.core.QgsGeometryGeneratorSymbolLayer

Bases: QgsSymbolLayer

Methods

clone

rtype

QgsSymbolLayer

create

param properties

drawPreviewIcon

param context

geometryExpression

Gets the expression to generate this geometry.

hasDataDefinedProperties

rtype

bool

isCompatibleWithSymbol

Will always return True.

layerType

rtype

str

properties

rtype

Dict[str, str]

render

Will render this symbol layer using the context.

setColor

param color

setGeometryExpression

Set the expression to generate this geometry.

setSubSymbol

param symbol

setSymbolType

Set the type of symbol which should be created.

startRender

param context

stopRender

param context

subSymbol

rtype

QgsSymbol

symbolType

Access the symbol type.

usedAttributes

param context

clone(self) → QgsSymbolLayer
Return type

QgsSymbolLayer

create(properties: Dict[str, str]) → QgsSymbolLayer
Parameters

properties (Dict[str) –

Return type

QgsSymbolLayer

drawPreviewIcon(self, context: QgsSymbolRenderContext, size: QSize)
Parameters
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, str]
Return type

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 (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) –

setSubSymbol(self, symbol: QgsSymbol) → bool
Parameters

symbol (QgsSymbol) –

Return type

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 (QgsSymbol.SymbolType) – The symbol type which shall be used below this symbol.

startRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

stopRender(self, context: QgsSymbolRenderContext)
Parameters

context (QgsSymbolRenderContext) –

subSymbol(self) → QgsSymbol
Return type

QgsSymbol

symbolType(self) → QgsSymbol.SymbolType

Access the symbol type. This defines the type of geometry that is created by this generator.

Return type

QgsSymbol.SymbolType

Returns

Symbol type

usedAttributes(self, context: QgsRenderContext) → Set[str]
Parameters

context (QgsRenderContext) –

Return type

Set[str]