QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsLayerTreeViewIndicator Class Reference

Indicator that can be used in a layer tree view to display icons next to items of the layer tree. More...

#include <qgslayertreeviewindicator.h>

Inheritance diagram for QgsLayerTreeViewIndicator:
Inheritance graph
[legend]

Signals

void changed ()
 Emitted when the indicator changes state (e.g.
 
void clicked (const QModelIndex &index)
 Emitted when user clicks on the indicator.
 

Public Member Functions

 QgsLayerTreeViewIndicator (QObject *parent=nullptr)
 Constructs an indicator, optionally transferring ownership to a parent QObject.
 
QIcon icon () const
 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.
 
QString toolTip () const
 Returns tool tip text that will be shown when user hovers mouse over the indicator.
 

Detailed Description

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.

Since
QGIS 3.2

Definition at line 35 of file qgslayertreeviewindicator.h.

Constructor & Destructor Documentation

◆ QgsLayerTreeViewIndicator()

QgsLayerTreeViewIndicator::QgsLayerTreeViewIndicator ( QObject *  parent = nullptr)
explicit

Constructs an indicator, optionally transferring ownership to a parent QObject.

Definition at line 19 of file qgslayertreeviewindicator.cpp.

Member Function Documentation

◆ changed

void QgsLayerTreeViewIndicator::changed ( )
signal

Emitted when the indicator changes state (e.g.

icon).

Since
QGIS 3.10

◆ clicked

void QgsLayerTreeViewIndicator::clicked ( const QModelIndex &  index)
signal

Emitted when user clicks on the indicator.

◆ icon()

QIcon QgsLayerTreeViewIndicator::icon ( ) const
inline

Indicator icon that will be displayed in the layer tree view.

Definition at line 43 of file qgslayertreeviewindicator.h.

◆ setIcon()

void QgsLayerTreeViewIndicator::setIcon ( const QIcon &  icon)
inline

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

Definition at line 45 of file qgslayertreeviewindicator.h.

◆ setToolTip()

void QgsLayerTreeViewIndicator::setToolTip ( const QString &  tip)
inline

Sets tool tip text.

Definition at line 54 of file qgslayertreeviewindicator.h.

◆ toolTip()

QString QgsLayerTreeViewIndicator::toolTip ( ) const
inline

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

Definition at line 52 of file qgslayertreeviewindicator.h.


The documentation for this class was generated from the following files: