16 #ifndef QGSLAYERTREEUTILS_H
17 #define QGSLAYERTREEUTILS_H
19 #include <qnamespace.h>
22 #include <QDomNodeList>
23 #include "qgis_core.h"
45 static bool readOldLegend(
QgsLayerTreeGroup *root,
const QDomElement &legendElem );
47 static bool readOldLegendLayerOrder(
const QDomElement &legendElem,
bool &hasCustomOrder, QStringList &order );
49 static QDomElement writeOldLegend( QDomDocument &doc,
QgsLayerTreeGroup *root,
bool hasCustomOrder,
const QList<QgsMapLayer *> &order );
52 static QString checkStateToXml( Qt::CheckState state );
54 static Qt::CheckState checkStateFromXml(
const QString &txt );
62 static bool layersEditable(
const QList<QgsLayerTreeLayer *> &layerNodes,
bool ignoreLayersWhichCannotBeToggled =
false );
65 static bool layersModified(
const QList<QgsLayerTreeLayer *> &layerNodes );
74 static void storeOriginalLayersProperties(
QgsLayerTreeGroup *group,
const QDomDocument *doc );
88 static void setLegendFilterByExpression(
QgsLayerTreeLayer &layer,
const QString &expr,
bool enabled =
true );
90 static QString legendFilterByExpression(
const QgsLayerTreeLayer &layer,
bool *enabled =
nullptr );
108 static QSet<QgsMapLayer *> collectMapLayersRecursive(
const QList<QgsLayerTreeNode *> &nodes );
Layer tree group node serves as a container for layers and further groups.
Layer tree node points to a map layer.
This class is a base class for nodes in a layer tree.
Assorted functions for dealing with layer trees.
Base class for all map layer types.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...