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

Abstract Methods

data

data Returns data associated with the item

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsVectorLabelLegendNode. See the FAQ for more details.

drawSymbol

drawSymbol

exportSymbolToJson

exportSymbolToJson

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(None) None
Parameters:
Return type:

QSizeF

Returns:

size of the item

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

Dict[str, QJsonValue]

Returns:

the json object