Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
468c784
commit 023ad46
Showing
3 changed files
with
154 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,123 @@ | ||
/** | ||
* Layer tree node points to a map layer. | ||
* | ||
* The node can exist also without a valid instance of a layer (just ID). That | ||
* means the referenced layer does not need to be loaded in order to use it | ||
* in layer tree. In such case, resolveReferences() method can be called | ||
* once the layer is loaded. | ||
* | ||
* A map layer is supposed to be present in one layer tree just once. It is | ||
* however possible that temporarily a layer exists in one tree more than just | ||
* once, e.g. while reordering items with drag and drop. | ||
* | ||
* @note added in 2.4 | ||
*/ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/layertree/qgslayertreelayer.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsLayerTreeLayer : QgsLayerTreeNode | ||
{ | ||
%TypeHeaderCode | ||
#include <qgslayertreelayer.h> | ||
%Docstring | ||
Layer tree node points to a map layer. | ||
|
||
The node can exist also without a valid instance of a layer (just ID). That | ||
means the referenced layer does not need to be loaded in order to use it | ||
in layer tree. In such case, resolveReferences() method can be called | ||
once the layer is loaded. | ||
|
||
A map layer is supposed to be present in one layer tree just once. It is | ||
however possible that temporarily a layer exists in one tree more than just | ||
once, e.g. while reordering items with drag and drop. | ||
|
||
.. versionadded:: 2.4 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslayertreelayer.h" | ||
%End | ||
public: | ||
explicit QgsLayerTreeLayer( QgsMapLayer* layer ); | ||
explicit QgsLayerTreeLayer( QgsMapLayer *layer ); | ||
|
||
explicit QgsLayerTreeLayer( const QString& layerId, const QString& name = QString() ); | ||
|
||
explicit QgsLayerTreeLayer( const QString &layerId, const QString &name = QString(), const QString &source = QString(), const QString &provider = QString() ); | ||
|
||
QString layerId() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
|
||
QgsMapLayer* layer() const; | ||
QgsMapLayer *layer() const; | ||
%Docstring | ||
:rtype: QgsMapLayer | ||
%End | ||
|
||
//! Get layer's name | ||
//! @note added in 3.0 | ||
QString name() const; | ||
//! Set layer's name | ||
//! @note added in 3.0 | ||
void setName( const QString& n ); | ||
%Docstring | ||
Returns the layer's name. | ||
.. versionadded:: 3.0 | ||
:rtype: str | ||
%End | ||
|
||
void setName( const QString &n ); | ||
%Docstring | ||
Sets the layer's name. | ||
.. versionadded:: 3.0 | ||
%End | ||
|
||
//! Read layer node from XML. Returns new instance. | ||
//! Does not resolve textual references to layers. Call resolveReferences() afterwards to do it. | ||
static QgsLayerTreeLayer* readXml( QDomElement& element ) /Factory/; | ||
//! Read layer node from XML. Returns new instance. | ||
//! Also resolves textual references to layers from the project (calls resolveReferences() internally). | ||
//! @note added in 3.0 | ||
static QgsLayerTreeLayer* readXml( QDomElement& element, const QgsProject* project ) /Factory/; | ||
static QgsLayerTreeLayer *readXml( QDomElement &element ) /Factory/; | ||
%Docstring | ||
Read layer node from XML. Returns new instance. | ||
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it. | ||
:rtype: QgsLayerTreeLayer | ||
%End | ||
|
||
static QgsLayerTreeLayer *readXml( QDomElement &element, const QgsProject *project ) /Factory/; | ||
%Docstring | ||
Read layer node from XML. Returns new instance. | ||
Also resolves textual references to layers from the project (calls resolveReferences() internally). | ||
.. versionadded:: 3.0 | ||
:rtype: QgsLayerTreeLayer | ||
%End | ||
|
||
virtual void writeXml( QDomElement& parentElement ); | ||
virtual void writeXml( QDomElement &parentElement ); | ||
|
||
virtual QString dump() const; | ||
%Docstring | ||
:rtype: str | ||
%End | ||
|
||
virtual QgsLayerTreeLayer* clone() const /Factory/; | ||
virtual QgsLayerTreeLayer *clone() const /Factory/; | ||
%Docstring | ||
:rtype: QgsLayerTreeLayer | ||
%End | ||
|
||
//! Resolves reference to layer from stored layer ID (if it has not been resolved already) | ||
//! \since QGIS 3.0 | ||
virtual void resolveReferences( const QgsProject *project, bool looseMatching = false ); | ||
|
||
%Docstring | ||
Resolves reference to layer from stored layer ID (if it has not been resolved already) | ||
.. versionadded:: 3.0 | ||
%End | ||
|
||
signals: | ||
//! emitted when a previously unavailable layer got loaded | ||
|
||
void layerLoaded(); | ||
//! emitted when a previously available layer got unloaded (from layer registry) | ||
//! @note added in 2.6 | ||
%Docstring | ||
Emitted when a previously unavailable layer got loaded. | ||
%End | ||
|
||
void layerWillBeUnloaded(); | ||
%Docstring | ||
Emitted when a previously available layer got unloaded (from layer registry). | ||
.. versionadded:: 2.6 | ||
%End | ||
|
||
protected: | ||
void attachToLayer(); | ||
|
||
private: | ||
QgsLayerTreeLayer( const QgsLayerTreeLayer& other ); | ||
|
||
private: | ||
QgsLayerTreeLayer( const QgsLayerTreeLayer &other ); | ||
}; | ||
|
||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/layertree/qgslayertreelayer.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters