15#ifndef QGSLAYERDEFINITION_H
16#define QGSLAYERDEFINITION_H
87 static bool exportLayerDefinition(
const QString &path,
const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage
SIP_OUT );
170 bool isLayerDependent(
const QString &layerId )
const;
173 QVector<QDomNode> mSortedLayerNodes;
174 QStringList mSortedLayerIds;
175 QSet<QString> mDependentLayerIds;
177 bool mHasMissingDependency;
178 void init(
const QDomDocument &doc );
183 static QList<QgsMapLayer *> loadLayerDefinitionLayersInternal( QDomDocument &document,
QgsReadWriteContext &context, QString &errorMessage );
LayerTreeInsertionMethod
Layer tree insertion methods.
@ OptimalInInsertionGroup
Layers are added at optimal locations across the insertion point's group.
FilePathType
File path types.
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.
DependencySorter(const QDomDocument &doc)
Constructor.
QVector< QDomNode > sortedLayerNodes() const
Gets the layer nodes in an order where they can be loaded incrementally without dependency break.
Holds generic methods for loading/exporting QLR files.
static QDomDocument exportLayerDefinitionLayers(const QList< QgsMapLayer * > &layers, const QgsReadWriteContext &context)
Returns the given layer as a layer definition document Layer definitions store the data source as wel...
static QList< QgsMapLayer * > loadLayerDefinitionLayers(QDomDocument &document, QgsReadWriteContext &context)
Creates new layers from a layer definition document.
static bool loadLayerDefinition(const QString &path, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage, Qgis::LayerTreeInsertionMethod insertMethod=Qgis::LayerTreeInsertionMethod::OptimalInInsertionGroup, const QgsLayerTreeRegistryBridge::InsertionPoint *insertPoint=nullptr)
Loads the QLR at path into QGIS.
static bool exportLayerDefinition(const QString &path, const QList< QgsLayerTreeNode * > &selectedTreeNodes, QString &errorMessage)
Exports the selected layer tree nodes to a QLR file.
Layer tree group node serves as a container for layers and further groups.
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,...
A container for the context for various read/write operations on objects.
A structure to define the insertion point to the layer tree.