Commit 47198c07 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent c3b7e82e
Pipeline #15935 failed with stage
in 40 seconds
......@@ -293,6 +293,8 @@ class MapView(QFrame):
lyrTreeNode = node.firstChildElement('MapViewLayerTree').toElement()
def copyLayerTree(parentSrc: QgsLayerTreeGroup, parentDst: QgsLayerTreeGroup):
for child in parentSrc.children():
if 'eotsv/locked' in child.customProperties():
continue
......@@ -302,6 +304,8 @@ class MapView(QFrame):
parentDst.addChildNode(child.clone())
s = ""
elif isinstance(child, QgsLayerTreeGroup):
if 'eotsv/locked' in child.customProperties():
continue
grp = QgsLayerTreeGroup()
grp.setName(child.name())
grp.setIsMutuallyExclusive(child.isMutuallyExclusive())
......@@ -311,8 +315,12 @@ class MapView(QFrame):
if not lyrTreeNode.isNull():
tree: QgsLayerTree = QgsLayerTree.readXml(lyrTreeNode, context)
tree.resolveReferences(QgsProject.instance(), looseMatching=True)
# todo:
# layerTree(tree, mapView.mLayerTree)
if len(tree.children()) > 0:
copyLayerTree(tree.children()[0], mapView.mLayerTreeModel.rootGroup())
# move sensor node to last position
mapView.mLayerTree.removeChildNode(mapView.mLayerTreeSensorNode)
# will be added again to the bottom
#mapView.mLayerTree.addChildNode(mapView.mLayerTreeSensorNode)
lyrNode = node.firstChildElement('MapViewProxyLayer').toElement()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment