diff --git a/meshroom/ui/graph.py b/meshroom/ui/graph.py index e1a756fbdd..0cde6b2ddd 100644 --- a/meshroom/ui/graph.py +++ b/meshroom/ui/graph.py @@ -952,9 +952,12 @@ def selectNodes(self, nodes, command=QItemSelectionModel.SelectionFlag.ClearAndS self.selectNodesByIndices(indices, command) @Slot(Node) - def selectFollowing(self, node: Node): + @Slot(Node, int) + def selectFollowing(self, node: Node, command=QItemSelectionModel.SelectionFlag.ClearAndSelect): """Select all the nodes that depend on `node`.""" - self.selectNodes(self._graph.dfsOnDiscover(startNodes=[node], reverse=True, dependenciesOnly=True)[0]) + self.selectNodes( + self._graph.dfsOnDiscover(startNodes=[node], reverse=True, dependenciesOnly=True)[0], command + ) self.selectedNode = node @Slot(int) diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 8ff01d4dbc..c74acbc7d1 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -864,7 +864,12 @@ Item { selectionMode = ItemSelectionModel.Toggle; } if(mouse.modifiers & Qt.AltModifier) { - uigraph.selectFollowing(node); + let selectFollowingMode = ItemSelectionModel.ClearAndSelect; + if(mouse.modifiers & Qt.ShiftModifier) { + selectFollowingMode = ItemSelectionModel.Select; + } + uigraph.selectFollowing(node, selectFollowingMode); + // Indicate selection has been dealt with by setting conservative Select mode. selectionMode = ItemSelectionModel.Select; } }