Class: QgsDefaultVectorLayerLegend

class qgis.core.QgsDefaultVectorLayerLegend

Bases: QgsMapLayerLegend

Default legend implementation for vector layers

Methods

childEvent

connectNotify

createLayerTreeModelLegendNodes

param nodeLayer

customEvent

disconnectNotify

isSignalConnected

readXml

param elem

receivers

sender

senderSignalIndex

setTextOnSymbolContent

Sets per-symbol content of labels for “text on symbol” functionality.

setTextOnSymbolEnabled

Sets whether the “text on symbol” functionality is enabled.

setTextOnSymbolTextFormat

Sets text format of symbol labels for “text on symbol” functionality.

textOnSymbolContent

Returns per-symbol content of labels for “text on symbol” functionality.

textOnSymbolEnabled

Returns whether the “text on symbol” functionality is enabled.

textOnSymbolTextFormat

Returns text format of symbol labels for “text on symbol” functionality.

timerEvent

writeXml

param doc

childEvent()
connectNotify()
createLayerTreeModelLegendNodes(self, nodeLayer: QgsLayerTreeLayer) → List[QgsLayerTreeModelLegendNode]
Parameters

nodeLayer (QgsLayerTreeLayer) –

Return type

List[QgsLayerTreeModelLegendNode]

customEvent()
disconnectNotify()
isSignalConnected()
readXml(self, elem: QDomElement, context: QgsReadWriteContext)
Parameters
receivers()
sender()
senderSignalIndex()
setTextOnSymbolContent(self, content: Dict[str, str])

Sets per-symbol content of labels for “text on symbol” functionality. In the passed dictionary the keys are rule keys of legend items, the values are labels to be shown.

New in version 3.2.

Parameters

content (Dict[str) –

setTextOnSymbolEnabled(self, enabled: bool)

Sets whether the “text on symbol” functionality is enabled. When enabled, legend symbols may have extra text rendered on top. The content of labels and their style is controlled by textOnSymbolContent() and textOnSymbolTextFormat().

New in version 3.2.

Parameters

enabled (bool) –

setTextOnSymbolTextFormat(self, format: QgsTextFormat)

Sets text format of symbol labels for “text on symbol” functionality.

New in version 3.2.

Parameters

format (QgsTextFormat) –

textOnSymbolContent(self) → Dict[str, str]

Returns per-symbol content of labels for “text on symbol” functionality. In the passed dictionary the keys are rule keys of legend items, the values are labels to be shown.

New in version 3.2.

Return type

Dict[str, str]

textOnSymbolEnabled(self) → bool

Returns whether the “text on symbol” functionality is enabled. When enabled, legend symbols may have extra text rendered on top. The content of labels and their style is controlled by textOnSymbolContent() and textOnSymbolTextFormat().

New in version 3.2.

Return type

bool

textOnSymbolTextFormat(self) → QgsTextFormat

Returns text format of symbol labels for “text on symbol” functionality.

New in version 3.2.

Return type

QgsTextFormat

timerEvent()
writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement
Parameters
Return type

QDomElement