QgsSimpleLegendNode class

Implementation of legend node interface for displaying arbitrary label with icon.

Base classes

class QgsLayerTreeModelLegendNode
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegend implementation.

Constructors, destructors, conversion operators

QgsSimpleLegendNode(QgsLayerTreeLayer* nodeLayer, const QString& label, const QIcon& icon = QIcon(), QObject* parent = nullptr, const QString& key = QString())
Constructor for QgsSimpleLegendNode.

Public functions

auto data(int role) const -> QVariant override
Returns data associated with the item. Must be implemented in derived class.

Function documentation

QgsSimpleLegendNode::QgsSimpleLegendNode(QgsLayerTreeLayer* nodeLayer, const QString& label, const QIcon& icon = QIcon(), QObject* parent = nullptr, const QString& key = QString())

Constructor for QgsSimpleLegendNode.

Parameters
nodeLayer layer node
label label
icon icon
parent attach a parent QObject to the legend node.
key the rule key