nodeview: further optimization of node view
This commit is contained in:
@@ -147,14 +147,10 @@ void NodeView::SelectWithDependencies(QList<Node *> nodes)
|
||||
|
||||
void NodeView::ItemsChanged()
|
||||
{
|
||||
QList<QGraphicsItem*> items = scene_.items();
|
||||
QHash<NodeEdge *, NodeViewEdge *>::const_iterator i;
|
||||
|
||||
foreach (QGraphicsItem* item, items) {
|
||||
NodeViewEdge* edge = dynamic_cast<NodeViewEdge*>(item);
|
||||
|
||||
if (edge != nullptr) {
|
||||
edge->Adjust();
|
||||
}
|
||||
for (i=scene_.edge_map().begin();i!=scene_.edge_map().end();i++) {
|
||||
i.value()->Adjust();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ const QHash<Node *, NodeViewItem *> &NodeViewScene::item_map() const
|
||||
return item_map_;
|
||||
}
|
||||
|
||||
const QHash<NodeEdge *, NodeViewEdge *> &NodeViewScene::edge_map() const
|
||||
{
|
||||
return edge_map_;
|
||||
}
|
||||
|
||||
void NodeViewScene::AddNode(Node* node)
|
||||
{
|
||||
NodeViewItem* item = new NodeViewItem();
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
void SetGraph(NodeGraph* graph);
|
||||
|
||||
const QHash<Node*, NodeViewItem*>& item_map() const;
|
||||
const QHash<NodeEdge*, NodeViewEdge*>& edge_map() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user