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.

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.

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

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

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