Class: QgsMapLayerConfigWidgetContext

Encapsulates the context for a QgsMapLayerConfigWidget.

Added in version 3.22.

class qgis.gui.QgsMapLayerConfigWidgetContext[source]

Bases: object

annotationId(self) str[source]

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

Return type:

str

layerTreeGroup(self) QgsLayerTreeGroup | None[source]

Returns the layer tree group associated with the widget.

Added in version 3.24.

Return type:

Optional[QgsLayerTreeGroup]

mapCanvas(self) QgsMapCanvas | None[source]

Returns the map canvas associated with the widget.

See also

setMapCanvas()

Return type:

Optional[QgsMapCanvas]

messageBar(self) QgsMessageBar | None[source]

Returns the message bar associated with the widget.

See also

setMessageBar()

Return type:

Optional[QgsMessageBar]

setAnnotationId(self, id: str | None)[source]

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

See also

annotationId()

Parameters:

id (Optional[str])

setLayerTreeGroup(self, group: QgsLayerTreeGroup | None)[source]

Sets the layer tree group associated with the widget.

See also

layerTreeGroup()

Added in version 3.24.

Parameters:

group (Optional[QgsLayerTreeGroup])

setMapCanvas(self, canvas: QgsMapCanvas | None)[source]

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 (Optional[QgsMapCanvas])

setMessageBar(self, bar: QgsMessageBar | None)[source]

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 (Optional[QgsMessageBar])