15 #ifndef QGSLAYERDEFINITION_H
16 #define QGSLAYERDEFINITION_H
19 #include "qgis_core.h"
50 static bool exportLayerDefinition( QString path,
const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage
SIP_OUT );
52 static bool exportLayerDefinition( QDomDocument doc,
const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage
SIP_OUT,
const QgsReadWriteContext &context );
63 static QDomDocument exportLayerDefinitionLayers(
const QList<QgsMapLayer *> &layers,
const QgsReadWriteContext &context );
77 static QList<QgsMapLayer *> loadLayerDefinitionLayers(
const QString &qlrfile )
SIP_FACTORY;
112 QVector<QDomNode> mSortedLayerNodes;
113 QStringList mSortedLayerIds;
115 bool mHasMissingDependency;
116 void init(
const QDomDocument &doc );
121 static QList<QgsMapLayer *> loadLayerDefinitionLayersInternal( QDomDocument &document,
QgsReadWriteContext &context, QString &errorMessage );
Class used to work with layer dependencies stored in a XML project or layer definition file.
QVector< QDomNode > sortedLayerNodes() const
Gets the layer nodes in an order where they can be loaded incrementally without dependency break.
bool hasMissingDependency() const
Whether some dependency is missing.
QStringList sortedLayerIds() const
Gets the layer IDs in an order where they can be loaded incrementally without dependency break.
bool hasCycle() const
Whether some cyclic dependency has been detected.
The QgsLayerDefinition class holds generic methods for loading/exporting QLR files.
Layer tree group node serves as a container for layers and further groups.
This class is a base class for nodes in a layer tree.
Base class for all map layer types.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The class is used as a container of context for various read/write operations on other objects.