QGIS API Documentation 3.43.0-Master (3ee7834ace6)
|
Listens to the updates in map layer registry and does changes in layer tree. More...
#include <qgslayertreeregistrybridge.h>
Classes | |
struct | InsertionPoint |
A structure to define the insertion point to the layer tree. More... | |
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) | |
Public Member Functions | |
QgsLayerTreeRegistryBridge (QgsLayerTreeGroup *root, QgsProject *project, QObject *parent=nullptr) | |
Create the instance that synchronizes given project with a layer tree root. | |
bool | isEnabled () const |
Qgis::LayerTreeInsertionMethod | layerInsertionMethod () const |
Returns the insertion method used to add layers to the tree. | |
InsertionPoint | layerInsertionPoint () const |
Returns the insertion point used to add layers to the tree. | |
bool | newLayersVisible () const |
void | setEnabled (bool enabled) |
void | setLayerInsertionMethod (Qgis::LayerTreeInsertionMethod method) |
Sets the insertion method used to add layers to the tree. | |
void | setLayerInsertionPoint (const InsertionPoint &insertionPoint) |
Set where the new layers should be inserted - can be used to follow current selection. | |
Q_DECL_DEPRECATED void | setLayerInsertionPoint (QgsLayerTreeGroup *parentGroup, int index) |
Set where the new layers should be inserted - can be used to follow current selection. | |
void | setNewLayersVisible (bool enabled) |
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 |
Qgis::LayerTreeInsertionMethod | mInsertionMethod = Qgis::LayerTreeInsertionMethod::AboveInsertionPoint |
QPointer< QgsLayerTreeGroup > | mInsertionPointGroup |
int | mInsertionPointPosition = 0 |
QStringList | mLayerIdsForRemoval |
bool | mNewLayersVisible |
QgsProject * | mProject = nullptr |
bool | mRegistryRemovingLayers |
QgsLayerTreeGroup * | mRoot = nullptr |
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.
Definition at line 45 of file qgslayertreeregistrybridge.h.
|
explicit |
Create the instance that synchronizes given project with a layer tree root.
Definition at line 24 of file qgslayertreeregistrybridge.cpp.
|
signal |
Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added layer)
|
protectedslot |
Definition at line 176 of file qgslayertreeregistrybridge.cpp.
|
protectedslot |
Definition at line 163 of file qgslayertreeregistrybridge.cpp.
|
inline |
Definition at line 69 of file qgslayertreeregistrybridge.h.
|
inline |
Returns the insertion method used to add layers to the tree.
Definition at line 104 of file qgslayertreeregistrybridge.h.
QgsLayerTreeRegistryBridge::InsertionPoint QgsLayerTreeRegistryBridge::layerInsertionPoint | ( | ) | const |
Returns the insertion point used to add layers to the tree.
Definition at line 52 of file qgslayertreeregistrybridge.cpp.
|
protectedslot |
Definition at line 58 of file qgslayertreeregistrybridge.cpp.
|
protectedslot |
Definition at line 124 of file qgslayertreeregistrybridge.cpp.
|
inline |
Definition at line 72 of file qgslayertreeregistrybridge.h.
|
protectedslot |
Definition at line 198 of file qgslayertreeregistrybridge.cpp.
|
inline |
Definition at line 68 of file qgslayertreeregistrybridge.h.
|
inline |
Sets the insertion method used to add layers to the tree.
Definition at line 98 of file qgslayertreeregistrybridge.h.
void QgsLayerTreeRegistryBridge::setLayerInsertionPoint | ( | const InsertionPoint & | insertionPoint | ) |
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 46 of file qgslayertreeregistrybridge.cpp.
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 40 of file qgslayertreeregistrybridge.cpp.
|
inline |
Definition at line 71 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 127 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 133 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 130 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 131 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 125 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 128 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 124 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 126 of file qgslayertreeregistrybridge.h.
|
protected |
Definition at line 123 of file qgslayertreeregistrybridge.h.