Subgroup: Layer

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.

New in version 2.4: Methods

blockSignals
childEvent
children
connectNotify
customEvent
deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
groupRemovedChildren
groupWillRemoveChildren
inherits
installEventFilter
isEnabled
isSignalConnected
isWidgetType
isWindowType
killTimer
layersAdded
layersWillBeRemoved
metaObject
moveToThread
newLayersVisible
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
removeLayersFromRegistry
sender
senderSignalIndex
setEnabled
setLayerInsertionPoint Set where the new layers should be inserted - can be used to follow current selection.
setNewLayersVisible
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr

Attributes

addedLayersToLayerTree Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added layer)
destroyed destroyed(self, QObject = None) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
addedLayersToLayerTree

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

New in version 2.6: [signal]

childEvent()
connectNotify()
customEvent()
disconnectNotify()
groupRemovedChildren(self)
groupWillRemoveChildren(self, node: QgsLayerTreeNode, indexFrom: int, indexTo: int)
isEnabled(self) → bool
isSignalConnected()
layersAdded(self, layers: Iterable[QgsMapLayer])
layersWillBeRemoved(self, layerIds: Iterable[str])
newLayersVisible(self) → bool
receivers()
removeLayersFromRegistry(self, layerIds: Iterable[str])
sender()
senderSignalIndex()
setEnabled(self, enabled: bool)
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.

setNewLayersVisible(self, enabled: bool)
timerEvent()