Class: QgsLayerTreeViewIndicator¶
Indicator that can be used in a layer tree view to display icons next to
items of the layer tree. They add extra context to the item and
interactivity (using clicked()
signal).
Indicators can be added/removed to individual layer tree items using
QgsLayerTreeView.addIndicator()
and
QgsLayerTreeView.removeIndicator()
calls.
Added in version 3.2.
Class Hierarchy¶
Base classes¶
Methods
Indicator icon that will be displayed in the layer tree view |
|
Sets indicator icon that will be displayed in the layer tree view |
|
Sets tool tip text |
|
Returns tool tip text that will be shown when user hovers mouse over the indicator |
Signals
Emitted when the indicator changes state (e.g. icon). |
|
Emitted when user clicks on the indicator |
- class qgis.gui.QgsLayerTreeViewIndicator[source]¶
Bases:
QObject
- __init__(parent: QObject | None = None)
Constructs an indicator, optionally transferring ownership to a parent QObject
- Parameters:
parent (Optional[QObject] = None)
- signal changed[source]¶
Emitted when the indicator changes state (e.g. icon).
Added in version 3.10.
- signal clicked(index: QModelIndex)[source]¶
Emitted when user clicks on the indicator
- Parameters:
index (QModelIndex)
- icon(self) QIcon [source]¶
Indicator icon that will be displayed in the layer tree view
- Return type:
QIcon