Class: QgsLayerTreeViewIndicator¶
- class qgis.gui.QgsLayerTreeViewIndicator¶
Bases:
PyQt5.QtCore.QObject
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()
andQgsLayerTreeView.removeIndicator()
calls.New in version 3.2.
QgsLayerTreeViewIndicator(parent: QObject = None) Constructs an indicator, optionally transferring ownership to a parent QObject
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.
Emitted when user clicks on the indicator [signal]
- changed¶
Emitted when the indicator changes state (e.g. icon).
New in version 3.10: [signal]
- childEvent(self, QChildEvent)¶
- clicked¶
Emitted when user clicks on the indicator [signal]
- Parameters
index (QModelIndex) –
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- icon(self) QIcon ¶
Indicator icon that will be displayed in the layer tree view
- Return type
QIcon
- isSignalConnected(self, QMetaMethod) bool ¶
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setIcon(self, icon: QIcon)¶
Sets indicator icon that will be displayed in the layer tree view
- Parameters
icon (QIcon) –
- setToolTip(self, tip: str)¶
Sets tool tip text
- Parameters
tip (str) –
- timerEvent(self, QTimerEvent)¶
- toolTip(self) str ¶
Returns tool tip text that will be shown when user hovers mouse over the indicator
- Return type
str