ensure nodeview is unset when project closes

This commit is contained in:
itsmattkc
2021-02-24 22:15:12 +11:00
parent a122e34029
commit 72dd80c90c
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -35,6 +35,11 @@ class NodePanel : public PanelWidget
public:
NodePanel(QWidget* parent);
NodeGraph* GetGraph() const
{
return node_view_->GetGraph();
}
void SetGraph(NodeGraph *graph)
{
node_view_->SetGraph(graph);
+5
View File
@@ -46,6 +46,11 @@ public:
virtual ~NodeView() override;
NodeGraph* GetGraph() const
{
return graph_;
}
/**
* @brief Sets the graph to view
*/
+5
View File
@@ -362,6 +362,11 @@ void MainWindow::ProjectClose(Project *p)
RemoveProjectPanel(panel);
}
}
// Close project from NodeView
if (node_panel_->GetGraph() == p) {
node_panel_->SetGraph(nullptr);
}
}
void MainWindow::SetApplicationProgressStatus(ProgressStatus status)