16 #ifndef QGSLAYERTREEUTILS_H 17 #define QGSLAYERTREEUTILS_H 19 #include <qnamespace.h> 22 #include <QDomNodeList> 23 #include "qgis_core.h" 46 static bool readOldLegend(
QgsLayerTreeGroup *root,
const QDomElement &legendElem );
48 static bool readOldLegendLayerOrder(
const QDomElement &legendElem,
bool &hasCustomOrder, QStringList &order );
50 static QDomElement writeOldLegend( QDomDocument &doc,
QgsLayerTreeGroup *root,
bool hasCustomOrder,
const QList<QgsMapLayer *> &order );
53 static QString checkStateToXml( Qt::CheckState state );
55 static Qt::CheckState checkStateFromXml(
const QString &txt );
58 static bool layersEditable(
const QList<QgsLayerTreeLayer *> &layerNodes );
60 static bool layersModified(
const QList<QgsLayerTreeLayer *> &layerNodes );
69 static void storeOriginalLayersProperties(
QgsLayerTreeGroup *group,
const QDomDocument *doc );
83 static void setLegendFilterByExpression(
QgsLayerTreeLayer &layer,
const QString &expr,
bool enabled =
true );
85 static QString legendFilterByExpression(
const QgsLayerTreeLayer &layer,
bool *enabled =
nullptr );
103 static QSet<QgsMapLayer *> collectMapLayersRecursive(
const QList<QgsLayerTreeNode *> &nodes );
129 #endif // QGSLAYERTREEUTILS_H Layer tree group node serves as a container for layers and further groups.
Base class for all map layer types.
Assorted functions for dealing with layer trees.
This class is a base class for nodes in a layer tree.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Layer tree node points to a map layer.