QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Signals | Public Member Functions | Protected Slots | Protected Attributes | List of all members
QgsLayerTreeRegistryBridge Class Reference

Listens to the updates in map layer registry and does changes in layer tree. More...

#include <qgslayertreeregistrybridge.h>

Signals

void addedLayersToLayerTree (QList< QgsMapLayer * > layers)
 Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added layer)

Public Member Functions

 QgsLayerTreeRegistryBridge (QgsLayerTreeGroup *root, QObject *parent=0)
void setEnabled (bool enabled)
bool isEnabled () const
void setNewLayersVisible (bool enabled)
bool newLayersVisible () const
void setLayerInsertionPoint (QgsLayerTreeGroup *parentGroup, int index)
 Set where the new layers should be inserted - can be used to follow current selection.

Protected Slots

void layersAdded (QList< QgsMapLayer * > layers)
void layersWillBeRemoved (QStringList layerIds)
void groupWillRemoveChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo)
void groupRemovedChildren ()
void removeLayersFromRegistry (QStringList layerIds)

Protected Attributes

QgsLayerTreeGroupmRoot
QStringList mLayerIdsForRemoval
bool mRegistryRemovingLayers
bool mEnabled
bool mNewLayersVisible
QgsLayerTreeGroupmInsertionPointGroup
int mInsertionPointIndex

Detailed Description

Listens to the updates in map layer registry and does changes in layer tree.

When connected to a layer tree, any layers added to the map layer registry will be also added to the layer tree. Similarly, map layers that are removed from registry will be removed from the layer tree.

If a layer is completely removed from the layer tree, it will be also removed from the map layer registry.

Note
added in 2.4

Constructor & Destructor Documentation

QgsLayerTreeRegistryBridge::QgsLayerTreeRegistryBridge ( QgsLayerTreeGroup root,
QObject *  parent = 0 
)
explicit

Member Function Documentation

void QgsLayerTreeRegistryBridge::addedLayersToLayerTree ( QList< QgsMapLayer * >  layers)
signal

Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added layer)

Note
added in 2.6
void QgsLayerTreeRegistryBridge::groupRemovedChildren ( )
protectedslot
void QgsLayerTreeRegistryBridge::groupWillRemoveChildren ( QgsLayerTreeNode node,
int  indexFrom,
int  indexTo 
)
protectedslot
bool QgsLayerTreeRegistryBridge::isEnabled ( ) const
inline
void QgsLayerTreeRegistryBridge::layersAdded ( QList< QgsMapLayer * >  layers)
protectedslot
void QgsLayerTreeRegistryBridge::layersWillBeRemoved ( QStringList  layerIds)
protectedslot
bool QgsLayerTreeRegistryBridge::newLayersVisible ( ) const
inline
void QgsLayerTreeRegistryBridge::removeLayersFromRegistry ( QStringList  layerIds)
protectedslot
void QgsLayerTreeRegistryBridge::setEnabled ( bool  enabled)
inline
void QgsLayerTreeRegistryBridge::setLayerInsertionPoint ( QgsLayerTreeGroup parentGroup,
int  index 
)

Set where the new layers should be inserted - can be used to follow current selection.

By default it is root group with zero index.

void QgsLayerTreeRegistryBridge::setNewLayersVisible ( bool  enabled)
inline

Member Data Documentation

bool QgsLayerTreeRegistryBridge::mEnabled
protected
QgsLayerTreeGroup* QgsLayerTreeRegistryBridge::mInsertionPointGroup
protected
int QgsLayerTreeRegistryBridge::mInsertionPointIndex
protected
QStringList QgsLayerTreeRegistryBridge::mLayerIdsForRemoval
protected
bool QgsLayerTreeRegistryBridge::mNewLayersVisible
protected
bool QgsLayerTreeRegistryBridge::mRegistryRemovingLayers
protected
QgsLayerTreeGroup* QgsLayerTreeRegistryBridge::mRoot
protected

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