Class: QgsVectorLabelLegendNode

A legend node for a labeling text symbol.

Added in version 3.20.

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLabelLegendNode

Base classes

QgsLayerTreeModelLegendNode

An abstract interface for legend items returned from QgsMapLayerLegend implementation.

QObject

class qgis.core.QgsVectorLabelLegendNode[source]

Bases: QgsLayerTreeModelLegendNode

__init__(nodeLayer: QgsLayerTreeLayer | None, labelSettings: QgsPalLayerSettings, parent: QObject | None = None)

QgsVectorLabelLegendNode

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

  • labelSettings (QgsPalLayerSettings) – setting of the label class

  • parent (Optional[QObject] = None) – the parent object

abstract data(self, role: int) Any[source]

data Returns data associated with the item

Parameters:

role (int) – the data role

Return type:

Any

Returns:

variant containing the data for the role

virtual drawSymbol(self, settings: QgsLegendSettings, ctx: QgsLayerTreeModelLegendNode.ItemContext | None, itemHeight: float) QSizeF[source]
virtual drawSymbol()
Parameters:
Return type:

QSizeF

Returns:

size of the item

virtual exportSymbolToJson(self, settings: QgsLegendSettings, context: QgsRenderContext) Dict[str, QJsonValue][source]
virtual exportSymbolToJson()
Parameters:
Return type:

Dict[str, QJsonValue]

Returns:

the json object