Class: QgsSymbolWidgetContext¶
- class qgis.gui.QgsSymbolWidgetContext¶
Bases:
sip.wrapper
Constructor for QgsSymbolWidgetContext.
QgsSymbolWidgetContext(other:
QgsSymbolWidgetContext
) Copy constructor.- Parameters
other – source QgsSymbolWidgetContext
Contains settings which reflect the context in which a symbol (or renderer) widget is shown, e.g., the map canvas and relevant expression contexts.
New in version 3.0:
Methods
Returns the list of additional expression context scopes to show as available within the layer.
Returns the expression context used for the widget, if set.
Returns list of scopes: global, project, atlas, map, layer.
Returns the map canvas associated with the widget.
Returns the message bar associated with the widget.
Sets a list of additional expression context scopes to show as available within the layer.
Sets the optional expression context used for the widget.
Sets the map canvas associated with the widget.
Sets the message
bar
associated with the widget.Sets the associated symbol
type
, if the widget is being shown as a subcomponent of a parent symbol configuration widget.Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget.
- additionalExpressionContextScopes(self) List[QgsExpressionContextScope] ¶
Returns the list of additional expression context scopes to show as available within the layer.
- Return type
- expressionContext(self) QgsExpressionContext ¶
Returns the expression context used for the widget, if set. This expression context is used for evaluating data defined symbol properties and for populating based expression widgets in the layer widget.
See also
- Return type
- globalProjectAtlasMapLayerScopes(self, layer: QgsMapLayer) List[QgsExpressionContextScope] ¶
Returns list of scopes: global, project, atlas, map, layer. Ownership is transferred to the caller.
New in version 3.0.
- Parameters
layer (QgsMapLayer) –
- Return type
- mapCanvas(self) QgsMapCanvas ¶
Returns the map canvas associated with the widget.
See also
- Return type
- messageBar(self) QgsMessageBar ¶
Returns the message bar associated with the widget.
See also
New in version 3.6.
- Return type
- setAdditionalExpressionContextScopes(self, scopes: Iterable[QgsExpressionContextScope])¶
Sets a list of additional expression context scopes to show as available within the layer.
- Parameters
scopes (Iterable[QgsExpressionContextScope]) – list of additional scopes which will be added in order to the end of the default expression context
See also
- setExpressionContext(self, context: QgsExpressionContext)¶
Sets the optional expression context used for the widget. This expression context is used for evaluating data defined symbol properties and for populating based expression widgets in the layer widget.
- Parameters
context (QgsExpressionContext) – expression context pointer. Ownership is not transferred.
See also
- setMapCanvas(self, canvas: QgsMapCanvas)¶
Sets the map canvas associated with the widget. This allows the widget to retrieve the current map scale and other properties from the canvas.
- Parameters
canvas (QgsMapCanvas) – map canvas
See also
- setMessageBar(self, bar: QgsMessageBar)¶
Sets the message
bar
associated with the widget. This allows the widget to push feedback messages to the appropriate message bar.See also
New in version 3.6.
- Parameters
bar (QgsMessageBar) –
- setSymbolType(self, type: QgsSymbol.SymbolType)¶
Sets the associated symbol
type
, if the widget is being shown as a subcomponent of a parent symbol configuration widget.See also
New in version 3.18.
- Parameters
type (QgsSymbol.SymbolType) –
- symbolType(self) QgsSymbol.SymbolType ¶
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget.
See also
New in version 3.18.
- Return type