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;
233 #endif // QGSLAYERTREE_H Layer tree group node serves as a container for layers and further groups.
The class is used as a container of context for various read/write operations on other objects...
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 QgsLayerTreeGroup * toGroup(QgsLayerTreeNode *node)
Cast node to a group.
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...
Namespace with helper functions for layer tree operations.
static bool isLayer(const QgsLayerTreeNode *node)
Check whether the node is a valid layer node.
This class is a base class for nodes in a layer tree.
static QgsLayerTreeGroup * readXml(QDomElement &element, const QgsReadWriteContext &context)
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or null on ...
static const QgsLayerTreeLayer * toLayer(const QgsLayerTreeNode *node)
Cast node to a layer.
Leaf node pointing to a layer.
QgsLayerTreeGroup * clone() const override
Returns a clone of the group.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
NodeType nodeType() const
Find out about type of the node. It is usually shorter to use convenience functions from QgsLayerTree...
Container of other groups and layers.
Layer tree node points to a map layer.