nodeview: clear edges first
This commit is contained in:
@@ -44,6 +44,13 @@ NodeViewContext::NodeViewContext(Node *context, QGraphicsItem *item) :
|
||||
connect(context_, &Node::NodeRemovedFromContext, this, &NodeViewContext::RemoveChild, Qt::DirectConnection);
|
||||
}
|
||||
|
||||
NodeViewContext::~NodeViewContext()
|
||||
{
|
||||
// Delete edges before items, because the edge constructor references the items
|
||||
qDeleteAll(edges_);
|
||||
edges_.clear();
|
||||
}
|
||||
|
||||
void NodeViewContext::AddChild(Node *node)
|
||||
{
|
||||
if (!context_) {
|
||||
|
||||
@@ -17,6 +17,8 @@ class NodeViewContext : public QObject, public QGraphicsRectItem
|
||||
public:
|
||||
NodeViewContext(Node *context, QGraphicsItem *item = nullptr);
|
||||
|
||||
virtual ~NodeViewContext() override;
|
||||
|
||||
Node *GetContext() const
|
||||
{
|
||||
return context_;
|
||||
|
||||
Reference in New Issue
Block a user