Class: QgsMapLayerConfigWidgetContext

class qgis.gui.QgsMapLayerConfigWidgetContext

Bases: sip.wrapper

Encapsulates the context for a QgsMapLayerConfigWidget.

New in version 3.22:

Methods

annotationId

Returns the item ID of the target annotation, when modifying an annotation from a QgsAnnotationLayer.

layerTreeGroup

Returns the layer tree group associated with the widget.

mapCanvas

Returns the map canvas associated with the widget.

messageBar

Returns the message bar associated with the widget.

setAnnotationId

Sets the item id of the target annotation, when modifying an annotation from a QgsAnnotationLayer.

setLayerTreeGroup

Sets the layer tree group associated with the widget.

setMapCanvas

Sets the map canvas associated with the widget.

setMessageBar

Sets the message bar associated with the widget.

annotationId(self) str

Returns the item ID of the target annotation, when modifying an annotation from a QgsAnnotationLayer.

Return type

str

layerTreeGroup(self) QgsLayerTreeGroup

Returns the layer tree group associated with the widget.

New in version 3.24.

Return type

QgsLayerTreeGroup

mapCanvas(self) QgsMapCanvas

Returns the map canvas associated with the widget.

See also

setMapCanvas()

Return type

QgsMapCanvas

messageBar(self) QgsMessageBar

Returns the message bar associated with the widget.

See also

setMessageBar()

Return type

QgsMessageBar

setAnnotationId(self, id: str)

Sets the item id of the target annotation, when modifying an annotation from a QgsAnnotationLayer.

See also

annotationId()

Parameters

id (str) –

setLayerTreeGroup(self, group: QgsLayerTreeGroup)

Sets the layer tree group associated with the widget.

See also

layerTreeGroup()

New in version 3.24.

Parameters

group (QgsLayerTreeGroup) –

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.

See also

mapCanvas()

Parameters

canvas (QgsMapCanvas) –

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

messageBar()

Parameters

bar (QgsMessageBar) –