QGIS API Documentation  2.14.0-Essen
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 (const 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=nullptr)
 
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)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Protected Slots

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

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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 = nullptr 
)
explicit

Definition at line 25 of file qgslayertreeregistrybridge.cpp.

Member Function Documentation

void QgsLayerTreeRegistryBridge::addedLayersToLayerTree ( const 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 ( const QList< QgsMapLayer * > &  layers)
protectedslot

Definition at line 47 of file qgslayertreeregistrybridge.cpp.

void QgsLayerTreeRegistryBridge::layersWillBeRemoved ( const 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 ( const 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: