QgsLayerTreeViewIndicator class

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.

Constructors, destructors, conversion operators

QgsLayerTreeViewIndicator(QObject* parent = nullptr) explicit
Constructs an indicator, optionally transferring ownership to a parent QObject.

Public functions

auto icon() const -> QIcon
Indicator icon that will be displayed in the layer tree view.
void setIcon(const QIcon& icon)
Sets indicator icon that will be displayed in the layer tree view.
void setToolTip(const QString& tip)
Sets tool tip text.
auto toolTip() const -> QString
Returns tool tip text that will be shown when user hovers mouse over the indicator.

Signals

void clicked(const QModelIndex& index)
Signal that is emitted when user clicks on the indicator.