QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Static Public Member Functions | List of all members
QgsLayerTreeUtils Class Reference

Assorted functions for dealing with layer trees. More...

#include <qgslayertreeutils.h>

Static Public Member Functions

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 QDomElement writeOldLegend (QDomDocument &doc, QgsLayerTreeGroup *root, bool hasCustomOrder, const QStringList &order)
 Return. More...
 
static QString checkStateToXml (Qt::CheckState state)
 Convert Qt::CheckState to QString. More...
 
static Qt::CheckState checkStateFromXml (QString txt)
 Convert QString to Qt::CheckState. 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 void removeInvalidLayers (QgsLayerTreeGroup *group)
 Remove layer nodes that refer to invalid layers. More...
 
static void removeChildrenOfEmbeddedGroups (QgsLayerTreeGroup *group)
 Remove subtree of embedded groups. Useful when saving layer tree. More...
 
static void updateEmbeddedGroupsProjectPath (QgsLayerTreeGroup *group)
 

Detailed Description

Assorted functions for dealing with layer trees.

Note
added in 2.4

Member Function Documentation

Qt::CheckState QgsLayerTreeUtils::checkStateFromXml ( QString  txt)
static

Convert QString to Qt::CheckState.

QString QgsLayerTreeUtils::checkStateToXml ( Qt::CheckState  state)
static

Convert Qt::CheckState to QString.

bool QgsLayerTreeUtils::layersEditable ( const QList< QgsLayerTreeLayer * > &  layerNodes)
static

Return true if any of the layers is editable.

bool QgsLayerTreeUtils::layersModified ( const QList< QgsLayerTreeLayer * > &  layerNodes)
static

Return true if any of the layers is modified.

bool QgsLayerTreeUtils::readOldLegend ( QgsLayerTreeGroup root,
const QDomElement &  legendElem 
)
static

Try to load layer tree from.

<legend> 

tag from project files from QGIS 2.2 and below

bool QgsLayerTreeUtils::readOldLegendLayerOrder ( const QDomElement &  legendElem,
bool &  hasCustomOrder,
QStringList &  order 
)
static

Try to load custom layer order from.

<legend> 

tag from project files from QGIS 2.2 and below

void QgsLayerTreeUtils::removeChildrenOfEmbeddedGroups ( QgsLayerTreeGroup group)
static

Remove subtree of embedded groups. Useful when saving layer tree.

void QgsLayerTreeUtils::removeInvalidLayers ( QgsLayerTreeGroup group)
static

Remove layer nodes that refer to invalid layers.

void QgsLayerTreeUtils::updateEmbeddedGroupsProjectPath ( QgsLayerTreeGroup group)
static
Note
not available in python bindings
QDomElement QgsLayerTreeUtils::writeOldLegend ( QDomDocument &  doc,
QgsLayerTreeGroup root,
bool  hasCustomOrder,
const QStringList &  order 
)
static

Return.

<legend> 

tag used in QGIS 2.2 and below


The documentation for this class was generated from the following files: