16 #ifndef QGSLAYERTREE_H
17 #define QGSLAYERTREE_H
107 QList<QgsMapLayer *> customLayerOrder()
const;
120 void setCustomLayerOrder(
const QList<QgsMapLayer *> &customLayerOrder );
133 void setCustomLayerOrder(
const QStringList &customLayerOrder )
SIP_PYNAME( setCustomLayerOrderByIds );
145 QList<QgsMapLayer *> layerOrder()
const;
155 bool hasCustomLayerOrder()
const;
165 void setHasCustomLayerOrder(
bool hasCustomLayerOrder );
183 void readLayerOrderFromXml(
const QDomElement &doc );
203 void customLayerOrderChanged();
210 void layerOrderChanged();
219 void hasCustomLayerOrderChanged(
bool hasCustomLayerOrder );
222 void nodeAddedChildren(
QgsLayerTreeNode *node,
int indexFrom,
int indexTo );
223 void nodeRemovedChildren();
228 void addMissingLayers();
230 bool mHasCustomLayerOrder = false;
Layer tree group node serves as a container for layers and further groups.
void writeXml(QDomElement &parentElement, const QgsReadWriteContext &context) override
Write group (tree) as XML element <layer-tree-group> and add it to the given parent element.
QgsLayerTreeGroup * clone() const override
Returns a clone of the group.
static QgsLayerTreeGroup * readXml(QDomElement &element, const QgsReadWriteContext &context)
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or nullptr ...
Layer tree node points to a map layer.
This class is a base class for nodes in a layer tree.
@ NodeGroup
Container of other groups and layers.
@ NodeLayer
Leaf node pointing to a layer.
NodeType nodeType() const
Find out about type of the node. It is usually shorter to use convenience functions from QgsLayerTree...
Namespace with helper functions for layer tree operations.
static bool isLayer(const QgsLayerTreeNode *node)
Check whether the node is a valid layer node.
static QgsLayerTreeLayer * toLayer(QgsLayerTreeNode *node)
Cast node to a layer.
static bool isGroup(QgsLayerTreeNode *node)
Check whether the node is a valid group node.
static const QgsLayerTreeLayer * toLayer(const QgsLayerTreeNode *node)
Cast node to a layer.
static QgsLayerTreeGroup * toGroup(QgsLayerTreeNode *node)
Cast node to a group.
The class is used as a container of context for various read/write operations on other objects.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.