added takenode function to graph
This commit is contained in:
@@ -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());
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ public:
|
||||
void AddNodeWithDependencies(Node* node);
|
||||
|
||||
/**
|
||||
* @brief Removes a Node from the graph and destroys it
|
||||
* @brief Removes a Node from the graph BUT doesn't destroy it. Ownership is returned to the caller.
|
||||
*/
|
||||
void RemoveNode(Node* node);
|
||||
void TakeNode(Node* node);
|
||||
|
||||
/**
|
||||
* @brief Retrieve a complete list of the nodes belonging to this graph
|
||||
|
||||
Reference in New Issue
Block a user