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: Enums
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.Signals
Attributes
-
additionalExpressionContextScopes
(self) → List[QgsExpressionContextScope]¶ Returns the list of additional expression context scopes to show as available within the layer.
-
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
-
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.
-
mapCanvas
(self) → QgsMapCanvas¶ Returns the map canvas associated with the widget.
See also
-
messageBar
(self) → QgsMessageBar¶ Returns the message bar associated with the widget.
See also
New in version 3.6.
-
setAdditionalExpressionContextScopes
(self, scopes: object)¶ Sets a list of additional expression context scopes to show as available within the layer.
- Parameters
scopes – 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 – 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 – 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.