added takenode function to graph

This commit is contained in:
itsmattkc
2019-08-13 18:40:39 +10:00
parent 03a0c64e15
commit 737442e513
2 changed files with 16 additions and 2 deletions
+14
View File
@@ -53,6 +53,20 @@ void NodeGraph::AddNodeWithDependencies(Node *node)
}
}
void NodeGraph::RemoveNode(Node *node)
{
if (!ContainsNode(node)) {
return;
}
node->setParent(nullptr);
disconnect(node, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SIGNAL(EdgeAdded(NodeEdgePtr)));
disconnect(node, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SIGNAL(EdgeRemoved(NodeEdgePtr)));
emit NodeRemoved(node);
}
QList<Node *> NodeGraph::nodes()
{
return static_qobjectlist_cast<Node>(children());