QGIS/python/core/auto_generated/layertree/qgslayertreeutils.sip.in

139 lines
4.9 KiB
Plaintext
Raw Normal View History

2017-04-24 15:52:13 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layertree/qgslayertreeutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayerTreeUtils
{
2017-04-24 15:52:13 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Assorted functions for dealing with layer trees.
2017-04-24 15:52:13 +02:00
.. versionadded:: 2.4
%End
2017-04-24 15:52:13 +02:00
%TypeHeaderCode
#include "qgslayertreeutils.h"
%End
public:
2017-04-24 15:52:13 +02:00
static bool readOldLegend( QgsLayerTreeGroup *root, const QDomElement &legendElem );
%Docstring
Try to load layer tree from \verbatim <legend> \endverbatim tag from project files from QGIS 2.2 and below
%End
static bool readOldLegendLayerOrder( const QDomElement &legendElem, bool &hasCustomOrder, QStringList &order );
%Docstring
Try to load custom layer order from \verbatim <legend> \endverbatim tag from project files from QGIS 2.2 and below
%End
static QDomElement writeOldLegend( QDomDocument &doc, QgsLayerTreeGroup *root, bool hasCustomOrder, const QList<QgsMapLayer *> &order );
%Docstring
Returns \verbatim <legend> \endverbatim tag used in QGIS 2.2 and below
2017-04-24 15:52:13 +02:00
%End
static QString checkStateToXml( Qt::CheckState state );
2017-04-24 15:52:13 +02:00
%Docstring
Convert Qt.CheckState to QString
%End
static Qt::CheckState checkStateFromXml( const QString &txt );
%Docstring
Convert QString to Qt.CheckState
%End
2017-04-24 15:52:13 +02:00
static bool layersEditable( const QList<QgsLayerTreeLayer *> &layerNodes );
%Docstring
Returns true if any of the layers is editable
2017-04-24 15:52:13 +02:00
%End
static bool layersModified( const QList<QgsLayerTreeLayer *> &layerNodes );
%Docstring
Returns true if any of the layers is modified
2017-04-24 15:52:13 +02:00
%End
2017-04-24 15:52:13 +02:00
static void removeInvalidLayers( QgsLayerTreeGroup *group );
%Docstring
Removes layer nodes that refer to invalid layers
%End
static void storeInvalidLayersProperties( QgsLayerTreeGroup *group, const QDomDocument *doc );
%Docstring
Stores in a custom layer node property the layer properties XML information for an invalid layer
.. versionadded:: 3.6
2017-04-24 15:52:13 +02:00
%End
2017-04-24 15:52:13 +02:00
static void replaceChildrenOfEmbeddedGroups( QgsLayerTreeGroup *group );
%Docstring
Remove subtree of embedded groups and replaces it with a custom property embedded-visible-layers
%End
2017-04-24 15:52:13 +02:00
static void updateEmbeddedGroupsProjectPath( QgsLayerTreeGroup *group, const QgsProject *project );
%Docstring
Updates an embedded ``group`` from a ``project``.
2017-04-24 15:52:13 +02:00
%End
static QStringList invisibleLayerList( QgsLayerTreeNode *node );
2017-04-24 15:52:13 +02:00
%Docstring
Gets invisible layers
2017-04-24 15:52:13 +02:00
%End
2017-04-24 15:52:13 +02:00
static void setLegendFilterByExpression( QgsLayerTreeLayer &layer, const QString &expr, bool enabled = true );
%Docstring
Sets the expression filter of a legend layer
2017-04-24 15:52:13 +02:00
%End
static QString legendFilterByExpression( const QgsLayerTreeLayer &layer, bool *enabled = 0 );
%Docstring
Returns the expression filter of a legend layer
2017-04-24 15:52:13 +02:00
%End
static bool hasLegendFilterExpression( const QgsLayerTreeGroup &group );
%Docstring
Test if one of the layers in a group has an expression filter
%End
static QgsLayerTreeLayer *insertLayerBelow( QgsLayerTreeGroup *group, const QgsMapLayer *refLayer, QgsMapLayer *layerToInsert );
%Docstring
2017-12-15 10:36:55 -04:00
Insert a QgsMapLayer just below another one
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param group: the tree group where layers are (can be the root group)
:param refLayer: the reference layer
:param layerToInsert: the new layer to insert just below the reference layer
:return: the new tree layer
%End
static QSet<QgsMapLayer *> collectMapLayersRecursive( const QList<QgsLayerTreeNode *> &nodes );
%Docstring
Returns map layers from the given list of layer tree nodes. Also recursively visits
child nodes of groups.
.. versionadded:: 3.4
%End
static int countMapLayerInTree( QgsLayerTreeNode *tree, QgsMapLayer *layer );
%Docstring
2018-09-26 12:08:26 +02:00
Returns how many occurrences of a map layer are there in a layer tree.
In normal situations there is at most one occurrence, but sometimes there
may be temporarily more: for example, during drag&drop, upon drop a new layer
node is created while the original dragged node is still in the tree, resulting
2018-09-26 12:08:26 +02:00
in two occurrences.
This is useful when deciding whether to start or stop listening to a signal
of a map layer within a layer tree and only connecting/disconnecting when
2018-09-26 12:08:26 +02:00
there is only one occurrence of that layer.
.. versionadded:: 3.4
2017-04-24 15:52:13 +02:00
%End
};
2017-04-24 15:52:13 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layertree/qgslayertreeutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/