Class: QgsMapLayerLegend¶
- class qgis.core.QgsMapLayerLegend¶
Bases:
PyQt5.QtCore.QObject
The
QgsMapLayerLegend
class is abstract interface for implementations of legends for one map layer.New in version 2.6.
QgsMapLayerLegend(parent: QObject = None) Constructor for QgsMapLayerLegend
Methods
Returns list of legend nodes to be used for a particular layer tree layer node.
Create new legend implementation for mesh layer
Create new legend implementation for a point cloud
layer
.Create new legend implementation for raster layer
Create new legend implementation for vector layer
Reads configuration from a DOM element previously written by
writeXml()
Writes configuration to a DOM element, to be used later with
readXml()
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- 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.
- Parameters:
nodeLayer (QgsLayerTreeLayer) –
- Return type:
- customEvent(self, QEvent)¶
- defaultMeshLegend(ml: QgsMeshLayer) QgsMapLayerLegend ¶
Create new legend implementation for mesh layer
- Parameters:
ml (QgsMeshLayer) –
- Return type:
- defaultPointCloudLegend(layer: QgsPointCloudLayer) QgsMapLayerLegend ¶
Create new legend implementation for a point cloud
layer
.New in version 3.18.
- Parameters:
layer (QgsPointCloudLayer) –
- Return type:
- defaultRasterLegend(rl: QgsRasterLayer) QgsMapLayerLegend ¶
Create new legend implementation for raster layer
- Parameters:
rl (QgsRasterLayer) –
- Return type:
- defaultVectorLegend(vl: QgsVectorLayer) QgsMapLayerLegend ¶
Create new legend implementation for vector layer
- Parameters:
vl (QgsVectorLayer) –
- Return type:
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- itemsChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- readXml(self, elem: QDomElement, context: QgsReadWriteContext)¶
Reads configuration from a DOM element previously written by
writeXml()
New in version 3.2.
- Parameters:
elem (QDomElement) –
context (QgsReadWriteContext) –
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶
- writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement ¶
Writes configuration to a DOM element, to be used later with
readXml()
New in version 3.2.
- Parameters:
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
QDomElement