Don't lock graph and node editor while computing nodes

Add possibilty to, while computing nodes:
add more nodes to the task manager,
edit, duplicate and remove nodes without breaking the tasks that are submitted
This commit is contained in:
Lee Geertsen 2019-08-12 18:41:15 +02:00 committed by Yann Lanthony
parent 51d6c18840
commit c00db25c23
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
5 changed files with 94 additions and 28 deletions

View file

@ -893,6 +893,21 @@ class Graph(BaseObject):
self.dfs(visitor=visitor, startNodes=[startNode], reverse=True)
return nodes, edges
@Slot(Node, result="QVariantList")
def onlyNodesFromNode(self, startNode, filterType=None):
nodes = []
edges = []
visitor = Visitor()
def discoverVertex(vertex, graph):
if not filterType or vertex.nodeType == filterType:
nodes.append(vertex)
visitor.discoverVertex = discoverVertex
visitor.examineEdge = lambda edge, graph: edges.append(edge)
self.dfs(visitor=visitor, startNodes=[startNode], reverse=True)
return nodes
def _applyExpr(self):
with GraphModification(self):
for node in self._nodes: