Subgroup: Map

Class: QgsMapLayerLegend

class qgis.core.QgsMapLayerLegend(parent: QObject = None)

Bases: PyQt5.QtCore.QObject

Constructor for QgsMapLayerLegend

The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer.

New in version 2.6: Methods

childEvent
connectNotify
createLayerTreeModelLegendNodes Returns list of legend nodes to be used for a particular layer tree layer node.
customEvent
defaultMeshLegend Create new legend implementation for mesh layer
defaultRasterLegend Create new legend implementation for raster layer
defaultVectorLegend Create new legend implementation for vector layer
disconnectNotify
isSignalConnected
readXml Reads configuration from a DOM element previously written by writeXml()
receivers
sender
senderSignalIndex
timerEvent
writeXml Writes configuration to a DOM element, to be used later with readXml()

Signals

itemsChanged Emitted when existing items/nodes got invalid and should be replaced by new ones [signal]

Attributes

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

Returns list of legend nodes to be used for a particular layer tree layer node. Ownership is transferred to the caller.

customEvent()
defaultMeshLegend(ml: QgsMeshLayer) → QgsMapLayerLegend

Create new legend implementation for mesh layer

defaultRasterLegend(rl: QgsRasterLayer) → QgsMapLayerLegend

Create new legend implementation for raster layer

defaultVectorLegend(vl: QgsVectorLayer) → QgsMapLayerLegend

Create new legend implementation for vector layer

disconnectNotify()
isSignalConnected()
itemsChanged

Emitted when existing items/nodes got invalid and should be replaced by new ones [signal]

readXml(self, elem: QDomElement, context: QgsReadWriteContext)

Reads configuration from a DOM element previously written by writeXml()

New in version 3.2.

receivers()
sender()
senderSignalIndex()
timerEvent()
writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement

Writes configuration to a DOM element, to be used later with readXml()

New in version 3.2.