Class: QgsLayerTreeRegistryBridge¶
- class qgis.core.QgsLayerTreeRegistryBridge¶
Bases:
PyQt5.QtCore.QObject
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.
QgsLayerTreeRegistryBridge(root:
QgsLayerTreeGroup
, project:QgsProject
, parent: QObject = None) Create the instance that synchronizes given project with a layer tree rootMethods
- param node:
- rtype:
bool
Returns the insertion method used to add layers to the tree
- param layers:
- param layerIds:
- rtype:
bool
- param layerIds:
- param enabled:
Sets the insertion
method
used to add layers to the treeSet where the new layers should be inserted - can be used to follow current selection.
- param enabled:
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- class InsertionPoint(group: QgsLayerTreeGroup, position: int)¶
Bases:
sip.wrapper
Constructs an insertion point as layer tree group with its corresponding position.
QgsLayerTreeRegistryBridge.InsertionPoint(QgsLayerTreeRegistryBridge.InsertionPoint)
- group¶
- position¶
- addedLayersToLayerTree¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- groupRemovedChildren(self)¶
- groupWillRemoveChildren(self, node: QgsLayerTreeNode, indexFrom: int, indexTo: int)¶
- Parameters:
node (QgsLayerTreeNode) –
indexFrom (int) –
indexTo (int) –
- isEnabled(self) bool ¶
- Return type:
bool
- isSignalConnected(self, QMetaMethod) bool ¶
- layerInsertionMethod(self) Qgis.LayerTreeInsertionMethod ¶
Returns the insertion method used to add layers to the tree
New in version 3.30.
- Return type:
- layersAdded(self, layers: Iterable[QgsMapLayer])¶
- Parameters:
layers (Iterable[QgsMapLayer]) –
- layersWillBeRemoved(self, layerIds: Iterable[str])¶
- Parameters:
layerIds (Iterable[str]) –
- newLayersVisible(self) bool ¶
- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- removeLayersFromRegistry(self, layerIds: Iterable[str])¶
- Parameters:
layerIds (Iterable[str]) –
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setEnabled(self, enabled: bool)¶
- Parameters:
enabled (bool) –
- setLayerInsertionMethod(self, method: Qgis.LayerTreeInsertionMethod)¶
Sets the insertion
method
used to add layers to the treeNew in version 3.30.
- Parameters:
method (Qgis.LayerTreeInsertionMethod) –
- setLayerInsertionPoint(self, parentGroup: QgsLayerTreeGroup, index: int)¶
Set where the new layers should be inserted - can be used to follow current selection. By default it is root group with zero index.
Deprecated since version QGIS: 3.10 use setLayerInsertionPoint( const InsertionPoint &insertionPoint ) instead
setLayerInsertionPoint(self, insertionPoint: QgsLayerTreeRegistryBridge.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.
New in version 3.10.
- Parameters:
parentGroup (QgsLayerTreeGroup) –
index (int) –
- setNewLayersVisible(self, enabled: bool)¶
- Parameters:
enabled (bool) –
- timerEvent(self, QTimerEvent)¶