QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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>

Inheritance diagram for QgsLayerTreeRegistryBridge:
Inheritance graph
[legend]

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) More...
 

Public Member Functions

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

Protected Slots

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

Protected Attributes

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

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

Definition at line 39 of file qgslayertreeregistrybridge.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file qgslayertreeregistrybridge.cpp.

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

Definition at line 127 of file qgslayertreeregistrybridge.cpp.

void QgsLayerTreeRegistryBridge::groupWillRemoveChildren ( QgsLayerTreeNode node,
int  indexFrom,
int  indexTo 
)
protectedslot

Definition at line 114 of file qgslayertreeregistrybridge.cpp.

bool QgsLayerTreeRegistryBridge::isEnabled ( ) const
inline

Definition at line 46 of file qgslayertreeregistrybridge.h.

void QgsLayerTreeRegistryBridge::layersAdded ( QList< QgsMapLayer * >  layers)
protectedslot

Definition at line 47 of file qgslayertreeregistrybridge.cpp.

void QgsLayerTreeRegistryBridge::layersWillBeRemoved ( QStringList  layerIds)
protectedslot

Definition at line 76 of file qgslayertreeregistrybridge.cpp.

bool QgsLayerTreeRegistryBridge::newLayersVisible ( ) const
inline

Definition at line 49 of file qgslayertreeregistrybridge.h.

void QgsLayerTreeRegistryBridge::removeLayersFromRegistry ( QStringList  layerIds)
protectedslot

Definition at line 148 of file qgslayertreeregistrybridge.cpp.

void QgsLayerTreeRegistryBridge::setEnabled ( bool  enabled)
inline

Definition at line 45 of file qgslayertreeregistrybridge.h.

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.

Definition at line 41 of file qgslayertreeregistrybridge.cpp.

void QgsLayerTreeRegistryBridge::setNewLayersVisible ( bool  enabled)
inline

Definition at line 48 of file qgslayertreeregistrybridge.h.

Member Data Documentation

bool QgsLayerTreeRegistryBridge::mEnabled
protected

Definition at line 73 of file qgslayertreeregistrybridge.h.

QgsLayerTreeGroup* QgsLayerTreeRegistryBridge::mInsertionPointGroup
protected

Definition at line 76 of file qgslayertreeregistrybridge.h.

int QgsLayerTreeRegistryBridge::mInsertionPointIndex
protected

Definition at line 77 of file qgslayertreeregistrybridge.h.

QStringList QgsLayerTreeRegistryBridge::mLayerIdsForRemoval
protected

Definition at line 71 of file qgslayertreeregistrybridge.h.

bool QgsLayerTreeRegistryBridge::mNewLayersVisible
protected

Definition at line 74 of file qgslayertreeregistrybridge.h.

bool QgsLayerTreeRegistryBridge::mRegistryRemovingLayers
protected

Definition at line 72 of file qgslayertreeregistrybridge.h.

QgsLayerTreeGroup* QgsLayerTreeRegistryBridge::mRoot
protected

Definition at line 70 of file qgslayertreeregistrybridge.h.


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