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 );
134 #endif // QGSLAYERTREEUTILS_H