QGIS/python/core/qgslayerdefinition.sip
Nyall Dawson c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00

22 lines
1.1 KiB
Plaintext

/**
* @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.
*/
class QgsLayerDefinition
{
%TypeHeaderCode
#include <qgslayerdefinition.h>
%End
public:
/** Loads the QLR at path into QGIS. New layers are added to rootGroup and the map layer registry*/
static bool loadLayerDefinition( const QString & path, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
/** Loads the QLR from the XML document. New layers are added to rootGroup and the map layer registry */
static bool loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
/** Export the selected layer tree nodes to a QLR file */
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/ );
};