QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
Classes | Static Public Member Functions | List of all members
QgsLayerDefinition Class Reference

The QgsLayerDefinition class holds generic methods for loading/exporting QLR files. More...

#include <qgslayerdefinition.h>

Classes

class  DependencySorter
 Class used to work with layer dependencies stored in a XML project or layer definition file. More...
 

Static Public Member Functions

static bool exportLayerDefinition (QString path, const QList< QgsLayerTreeNode * > &selectedTreeNodes, QString &errorMessage)
 Export the selected layer tree nodes to a QLR file. More...
 
static bool exportLayerDefinition (QDomDocument doc, const QList< QgsLayerTreeNode * > &selectedTreeNodes, QString &errorMessage, const QString &relativeBasePath=QString::null)
 Export the selected layer tree nodes to a QLR-XML document. More...
 
static bool loadLayerDefinition (const QString &path, QgsLayerTreeGroup *rootGroup, QString &errorMessage)
 Loads the QLR at path into QGIS. More...
 
static bool loadLayerDefinition (QDomDocument doc, QgsLayerTreeGroup *rootGroup, QString &errorMessage)
 Loads the QLR from the XML document. More...
 

Detailed Description

The QgsLayerDefinition class holds generic methods for loading/exporting QLR files.

QLR files are an export of the layer xml including the style and datasource location. There is no link to the QLR file once loaded. Consider the QLR file a mini project file for layers and styles. QLR files also store the layer tree info for the exported layers, including group information.

Definition at line 27 of file qgslayerdefinition.h.

Member Function Documentation

bool QgsLayerDefinition::exportLayerDefinition ( QString  path,
const QList< QgsLayerTreeNode * > &  selectedTreeNodes,
QString errorMessage 
)
static

Export the selected layer tree nodes to a QLR file.

Definition at line 148 of file qgslayerdefinition.cpp.

bool QgsLayerDefinition::exportLayerDefinition ( QDomDocument  doc,
const QList< QgsLayerTreeNode * > &  selectedTreeNodes,
QString errorMessage,
const QString relativeBasePath = QString::null 
)
static

Export the selected layer tree nodes to a QLR-XML document.

Definition at line 172 of file qgslayerdefinition.cpp.

bool QgsLayerDefinition::loadLayerDefinition ( const QString path,
QgsLayerTreeGroup rootGroup,
QString errorMessage 
)
static

Loads the QLR at path into QGIS.

New layers are added to rootGroup and the map layer registry

Definition at line 28 of file qgslayerdefinition.cpp.

bool QgsLayerDefinition::loadLayerDefinition ( QDomDocument  doc,
QgsLayerTreeGroup rootGroup,
QString errorMessage 
)
static

Loads the QLR from the XML document.

New layers are added to rootGroup and the map layer registry

Definition at line 51 of file qgslayerdefinition.cpp.


The documentation for this class was generated from the following files: