Class: QgsVectorLabelLegendNode

Produces legend node for a labeling text symbol

Added in version 3.20.

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLabelLegendNode

Base classes

QgsLayerTreeModelLegendNode

The QgsLegendRendererItem class is 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

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

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

QSizeF

Returns:

size of the item

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

Dict[str, QJsonValue]

Returns:

the json object