18#ifndef QGSLAYERTREECUSTOMNODE_H
19#define QGSLAYERTREECUSTOMNODE_H
28using namespace Qt::StringLiterals;
58 SIP_PYOBJECT __repr__();
60 QString str = u
"<QgsLayerTreeCustomNode: %1>"_s.arg( sipCpp->name() );
61 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
68 QString
nodeId()
const {
return mId; };
73 QString
name()
const override;
78 void setName(
const QString &name )
override;
90 QString
dump()
const override;
94 void resolveReferences( const
QgsProject *project,
bool looseMatching = false ) override;
Layer tree custom node serves as a node for objects that are not layers nor groups.
QString nodeId() const
Returns the node's unique identifier.
QgsLayerTreeCustomNode(const QString &nodeId, const QString &nodeName=QString(), bool checked=true)
Constructor to create custom nodes that represent application objects other than layers and groups.
virtual void setName(const QString &name)=0
Set name of the node.
virtual QString dump() const =0
Returns string with layer tree structure. For debug purposes only.
virtual void writeXml(QDomElement &parentElement, const QgsReadWriteContext &context)=0
Write layer tree to XML.
static QgsLayerTreeNode * readXml(QDomElement &element, const QgsReadWriteContext &context)
Read layer tree from XML.
virtual QString name() const =0
Returns name of the node.
QgsLayerTreeNode(NodeType t, bool checked=true)
Constructor.
virtual QgsLayerTreeNode * clone() const =0
Create a copy of the node. Returns new instance.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A container for the context for various read/write operations on objects.