Class: QgsDataItemGuiContext¶
Encapsulates the context in which a QgsDataItem
is shown
within the application GUI.
Added in version 3.6.
Methods
Returns the map canvas associated with the item. |
|
Returns the associated message bar. |
|
Sets the map canvas associated with the data item. |
|
Sets the associated message bar. |
|
Sets the associated view. |
|
Returns the associated view. |
- class qgis.gui.QgsDataItemGuiContext[source]¶
Bases:
object
- mapCanvas(self) QgsMapCanvas | None [source]¶
Returns the map canvas associated with the item.
See also
Added in version 3.44.
- Return type:
Optional[QgsMapCanvas]
- messageBar(self) QgsMessageBar | None [source]¶
Returns the associated message bar.
This bar can be used to provide non-blocking feedback to users.
See also
- Return type:
Optional[QgsMessageBar]
- setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets the map canvas associated with the data item.
This allows the item to retrieve the current map scale and other properties from the canvas.
See also
Added in version 3.44.
- Parameters:
canvas (Optional[QgsMapCanvas])
- setMessageBar(self, bar: QgsMessageBar | None)[source]¶
Sets the associated message
bar
.This bar can be used to provide non-blocking feedback to users.
See also
- Parameters:
bar (Optional[QgsMessageBar])
- setView(self, view: QgsBrowserTreeView | None)[source]¶
Sets the associated
view
.See also
Added in version 3.28.
- Parameters:
view (Optional[QgsBrowserTreeView])
- view(self) QgsBrowserTreeView | None [source]¶
Returns the associated view.
See also
Added in version 3.28.
- Return type:
Optional[QgsBrowserTreeView]