Class: QgsVectorLabelLegendNode¶
A legend node for a labeling text symbol.
Added in version 3.20.
Class Hierarchy¶
Base classes¶
An abstract interface for legend items returned from |
|
Abstract Methods
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 |
|
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:
settings (QgsLegendSettings) – the legend settings
ctx (Optional[QgsLayerTreeModelLegendNode.ItemContext]) – context for the item
itemHeight (float) – the height of the item
- Return type:
QSizeF
- Returns:
size of the item
- virtual exportSymbolToJson(self, settings: QgsLegendSettings, context: QgsRenderContext) Dict[str, QJsonValue] [source]¶
- virtual exportSymbolToJson(None) None
- Parameters:
settings (QgsLegendSettings) – the legend settings
context (QgsRenderContext) – the item context
- Return type:
Dict[str, QJsonValue]
- Returns:
the json object