Class: QgsLayerTreeCustomNode¶
Layer tree custom node serves as a node for objects that are not layers nor groups.
They are created, and can be found based on a node ID, which should be unique in the whole layer tree.
Added in version 4.0.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Base class for nodes in a layer tree. |
|
Abstract Methods
Returns the node's name. |
|
Sets the node's name. |
|
Write custom node as XML element <layer-tree-custom-node> and add it to the given parent element. |
Methods
Returns the node's unique identifier. |
Static Methods
Read custom node from XML element <layer-tree-custom-node> and return the newly created node (or |
- class qgis.core.QgsLayerTreeCustomNode[source]¶
Bases:
QgsLayerTreeNode- __init__(nodeId: str | None, nodeName: str | None = '', checked: bool = True)
Constructor to create custom nodes that represent application objects other than layers and groups.
- static readXml(element: QDomElement, context: QgsReadWriteContext) QgsLayerTreeCustomNode | None[source]¶
Read custom node from XML element <layer-tree-custom-node> and return the newly created node (or
Noneon error).- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
- abstract setName(self, name: str | None)[source]¶
Sets the node’s name.
- Parameters:
name (Optional[str])
- abstract writeXml(self, parentElement: QDomElement, context: QgsReadWriteContext)[source]¶
Write custom node as XML element <layer-tree-custom-node> and add it to the given parent element.
- Parameters:
parentElement (QDomElement)
context (QgsReadWriteContext)