ui: Intermediate fix to avoid early QWidget deletion due to smart pointers

TODO: get rid of smart pointers for Qt classes in QtGraphView
This commit is contained in:
Eberhard Graether
2017-11-09 16:32:26 +01:00
parent 78d93e50dd
commit ae37145d22
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -356,6 +356,9 @@ void QtGraphView::clear()
m_oldActiveNode.reset();
m_activeNodes.clear();
m_oldOldNodes = m_oldNodes;
m_oldOldEdges = m_oldEdges;
m_nodes.clear();
m_edges.clear();
@@ -777,6 +780,9 @@ void QtGraphView::switchToNewGraphData()
edge->setParentItem(nullptr);
}
m_oldOldNodes = m_oldNodes;
m_oldOldEdges = m_oldEdges;
m_oldNodes = m_nodes;
m_oldEdges = m_edges;
+2
View File
@@ -123,9 +123,11 @@ private:
std::list<std::shared_ptr<QtGraphEdge>> m_edges;
std::list<std::shared_ptr<QtGraphEdge>> m_oldEdges;
std::list<std::shared_ptr<QtGraphEdge>> m_oldOldEdges;
std::list<std::shared_ptr<QtGraphNode>> m_nodes;
std::list<std::shared_ptr<QtGraphNode>> m_oldNodes;
std::list<std::shared_ptr<QtGraphNode>> m_oldOldNodes;
std::vector<std::shared_ptr<QtGraphNode>> m_activeNodes;
std::shared_ptr<QtGraphNode> m_oldActiveNode;