2015-01-19 16:36:40 +10:00
|
|
|
/**
|
|
|
|
* @brief 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.
|
|
|
|
*/
|
2015-03-24 12:01:18 +01:00
|
|
|
class QgsLayerDefinition
|
2015-01-19 09:22:10 +10:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgslayerdefinition.h>
|
|
|
|
%End
|
2015-03-24 12:01:18 +01:00
|
|
|
public:
|
2015-04-30 17:26:58 +10:00
|
|
|
/** Loads the QLR at path into QGIS. New layers are added to rootGroup and the map layer registry*/
|
2015-03-24 12:01:18 +01:00
|
|
|
static bool loadLayerDefinition( const QString & path, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
|
2015-04-30 17:26:58 +10:00
|
|
|
/** Loads the QLR from the XML document. New layers are added to rootGroup and the map layer registry */
|
2015-03-24 12:01:18 +01:00
|
|
|
static bool loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
|
2015-04-30 17:26:58 +10:00
|
|
|
/** Export the selected layer tree nodes to a QLR file */
|
2015-10-07 11:55:34 +11:00
|
|
|
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/ );
|
2015-01-19 09:22:10 +10:00
|
|
|
};
|
|
|
|
|