Class: QgsSimpleLegendNode

Implementation of legend node interface for displaying arbitrary labels with icons.

Class Hierarchy

Inheritance diagram of qgis.core.QgsSimpleLegendNode

Base classes

QgsLayerTreeModelLegendNode

An abstract interface for legend items returned from QgsMapLayerLegend implementation.

QObject

class qgis.core.QgsSimpleLegendNode[source]

Bases: QgsLayerTreeModelLegendNode

__init__(nodeLayer: QgsLayerTreeLayer | None, label: str | None, icon: QIcon = QIcon(), parent: QObject | None = None, key: str | None = '')

Constructor for QgsSimpleLegendNode.

Parameters:
  • nodeLayer (Optional[QgsLayerTreeLayer]) – layer node

  • label (Optional[str]) – label

  • icon (QIcon = QIcon()) – icon

  • parent (Optional[QObject] = None) – attach a parent QObject to the legend node.

  • key (Optional[str] = '') – the rule key