QGIS API Documentation
3.0.2-Girona (307d082)
|
Assorted functions for dealing with layer trees. More...
#include <qgslayertreeutils.h>
Static Public Member Functions | |
static Qt::CheckState | checkStateFromXml (const QString &txt) |
Convert QString to Qt::CheckState. More... | |
static QString | checkStateToXml (Qt::CheckState state) |
Convert Qt::CheckState to QString. More... | |
static bool | hasLegendFilterExpression (const QgsLayerTreeGroup &group) |
Test if one of the layers in a group has an expression filter. More... | |
static QgsLayerTreeLayer * | insertLayerBelow (QgsLayerTreeGroup *group, const QgsMapLayer *refLayer, QgsMapLayer *layerToInsert) |
Insert a QgsMapLayer just below another one. More... | |
static QStringList | invisibleLayerList (QgsLayerTreeNode *node) |
get invisible layers More... | |
static bool | layersEditable (const QList< QgsLayerTreeLayer *> &layerNodes) |
Return true if any of the layers is editable. More... | |
static bool | layersModified (const QList< QgsLayerTreeLayer *> &layerNodes) |
Return true if any of the layers is modified. More... | |
static QString | legendFilterByExpression (const QgsLayerTreeLayer &layer, bool *enabled=nullptr) |
Return the expression filter of a legend layer. More... | |
static bool | readOldLegend (QgsLayerTreeGroup *root, const QDomElement &legendElem) |
Try to load layer tree from. More... | |
static bool | readOldLegendLayerOrder (const QDomElement &legendElem, bool &hasCustomOrder, QStringList &order) |
Try to load custom layer order from. More... | |
static void | removeInvalidLayers (QgsLayerTreeGroup *group) |
Remove layer nodes that refer to invalid layers. More... | |
static void | replaceChildrenOfEmbeddedGroups (QgsLayerTreeGroup *group) |
Remove subtree of embedded groups and replaces it with a custom property embedded-visible-layers. More... | |
static void | setLegendFilterByExpression (QgsLayerTreeLayer &layer, const QString &expr, bool enabled=true) |
Set the expression filter of a legend layer. More... | |
static void | updateEmbeddedGroupsProjectPath (QgsLayerTreeGroup *group, const QgsProject *project) |
static QDomElement | writeOldLegend (QDomDocument &doc, QgsLayerTreeGroup *root, bool hasCustomOrder, const QList< QgsMapLayer *> &order) |
Return. More... | |
Assorted functions for dealing with layer trees.
Definition at line 40 of file qgslayertreeutils.h.
|
static |
Convert QString to Qt::CheckState.
Definition at line 195 of file qgslayertreeutils.cpp.
|
static |
Convert Qt::CheckState to QString.
Definition at line 181 of file qgslayertreeutils.cpp.
|
static |
Test if one of the layers in a group has an expression filter.
Definition at line 382 of file qgslayertreeutils.cpp.
|
static |
Insert a QgsMapLayer just below another one.
group | the tree group where layers are (can be the root group) |
refLayer | the reference layer |
layerToInsert | the new layer to insert just below the reference layer |
Definition at line 396 of file qgslayertreeutils.cpp.
|
static |
get invisible layers
Definition at line 309 of file qgslayertreeutils.cpp.
|
static |
Return true if any of the layers is editable.
Definition at line 263 of file qgslayertreeutils.cpp.
|
static |
Return true if any of the layers is modified.
Definition at line 277 of file qgslayertreeutils.cpp.
|
static |
Return the expression filter of a legend layer.
Definition at line 375 of file qgslayertreeutils.cpp.
|
static |
Try to load layer tree from.
<legend>
tag from project files from QGIS 2.2 and below
Definition at line 28 of file qgslayertreeutils.cpp.
|
static |
Try to load custom layer order from.
<legend>
tag from project files from QGIS 2.2 and below
Definition at line 80 of file qgslayertreeutils.cpp.
|
static |
Remove layer nodes that refer to invalid layers.
Definition at line 291 of file qgslayertreeutils.cpp.
|
static |
Remove subtree of embedded groups and replaces it with a custom property embedded-visible-layers.
Definition at line 331 of file qgslayertreeutils.cpp.
|
static |
Set the expression filter of a legend layer.
Definition at line 369 of file qgslayertreeutils.cpp.
|
static |
Definition at line 351 of file qgslayertreeutils.cpp.
|
static |
Return.
<legend>
tag used in QGIS 2.2 and below
Definition at line 170 of file qgslayertreeutils.cpp.