15 #ifndef QGSLAYERDEFINITION_H
16 #define QGSLAYERDEFINITION_H
19 #include "qgis_core.h"
64 static bool exportLayerDefinition(
const QString &path,
const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage
SIP_OUT );
78 static bool exportLayerDefinition(
const QString &path,
const QList<QgsLayerTreeNode *> &selectedTreeNodes,
Qgis::FilePathType pathType, QString &errorMessage
SIP_OUT );
83 static bool exportLayerDefinition( QDomDocument doc,
const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage
SIP_OUT,
const QgsReadWriteContext &context );
94 static QDomDocument exportLayerDefinitionLayers(
const QList<QgsMapLayer *> &layers,
const QgsReadWriteContext &context );
108 static QList<QgsMapLayer *> loadLayerDefinitionLayers(
const QString &qlrfile )
SIP_FACTORY;
143 QVector<QDomNode> mSortedLayerNodes;
144 QStringList mSortedLayerIds;
146 bool mHasMissingDependency;
147 void init(
const QDomDocument &doc );
152 static QList<QgsMapLayer *> loadLayerDefinitionLayersInternal( QDomDocument &document,
QgsReadWriteContext &context, QString &errorMessage );
FilePathType
File path types.
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.