QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Functions
QgsLayerTree Namespace Reference

Namespace with helper functions for layer tree operations. More...

Functions

bool isGroup (QgsLayerTreeNode *node)
 Check whether the node is a valid group node. More...
 
bool isLayer (QgsLayerTreeNode *node)
 Check whether the node is a valid layer node. More...
 
QgsLayerTreeGrouptoGroup (QgsLayerTreeNode *node)
 Cast node to a group. No type checking is done - use isGroup() to find out whether this operation is legal. More...
 
QgsLayerTreeLayertoLayer (QgsLayerTreeNode *node)
 Cast node to a layer. No type checking is done - use isLayer() to find out whether this operation is legal. More...
 

Detailed Description

Namespace with helper functions for layer tree operations.

Only generally useful routines should be here. Miscellaneous utility functions for work with the layer tree are in QgsLayerTreeUtils class.

Note
added in 2.4

Function Documentation

◆ isGroup()

bool QgsLayerTree::isGroup ( QgsLayerTreeNode node)
inline

Check whether the node is a valid group node.

Definition at line 34 of file qgslayertree.h.

◆ isLayer()

bool QgsLayerTree::isLayer ( QgsLayerTreeNode node)
inline

Check whether the node is a valid layer node.

Definition at line 40 of file qgslayertree.h.

◆ toGroup()

QgsLayerTreeGroup* QgsLayerTree::toGroup ( QgsLayerTreeNode node)
inline

Cast node to a group. No type checking is done - use isGroup() to find out whether this operation is legal.

Definition at line 46 of file qgslayertree.h.

◆ toLayer()

QgsLayerTreeLayer* QgsLayerTree::toLayer ( QgsLayerTreeNode node)
inline

Cast node to a layer. No type checking is done - use isLayer() to find out whether this operation is legal.

Definition at line 52 of file qgslayertree.h.