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() and QgsLayerTreeView.removeIndicator() calls.

New in version 3.2.

QgsLayerTreeViewIndicator(parent: QObject = None) Constructs an indicator, optionally transferring ownership to a parent QObject

Methods

childEvent

connectNotify

customEvent

disconnectNotify

icon

Indicator icon that will be displayed in the layer tree view

isSignalConnected

receivers

sender

senderSignalIndex

setIcon

Sets indicator icon that will be displayed in the layer tree view

setToolTip

Sets tool tip text

timerEvent

toolTip

Returns tool tip text that will be shown when user hovers mouse over the indicator

Signals

changed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

clicked

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

childEvent(self, QChildEvent)
clicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

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