added some more timeline functions
This commit is contained in:
+17
-2
@@ -53,13 +53,13 @@ void NodeGraph::AddNodeWithDependencies(Node *node)
|
||||
}
|
||||
}
|
||||
|
||||
void NodeGraph::RemoveNode(Node *node)
|
||||
void NodeGraph::TakeNode(Node *node, QObject* new_parent)
|
||||
{
|
||||
if (!ContainsNode(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
node->setParent(nullptr);
|
||||
node->setParent(new_parent);
|
||||
|
||||
disconnect(node, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SIGNAL(EdgeAdded(NodeEdgePtr)));
|
||||
disconnect(node, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SIGNAL(EdgeRemoved(NodeEdgePtr)));
|
||||
@@ -67,6 +67,21 @@ void NodeGraph::RemoveNode(Node *node)
|
||||
emit NodeRemoved(node);
|
||||
}
|
||||
|
||||
QList<Node *> NodeGraph::TakeNodeWithItsDependencies(Node *node, QObject *new_parent)
|
||||
{
|
||||
if (!ContainsNode(node)) {
|
||||
return QList<Node*>();
|
||||
}
|
||||
|
||||
QList<Node*> deps = node->GetExclusiveDependencies();
|
||||
|
||||
foreach (Node* d, deps) {
|
||||
TakeNode(d, new_parent);
|
||||
}
|
||||
|
||||
return deps;
|
||||
}
|
||||
|
||||
QList<Node *> NodeGraph::nodes()
|
||||
{
|
||||
return static_qobjectlist_cast<Node>(children());
|
||||
|
||||
Reference in New Issue
Block a user