UI: GraphWindow: Fix close event handling.

This commit is contained in:
Nodir Temirkhodjaev 2018-03-16 19:08:58 +05:00
parent fd4dd77325
commit 644e3a253f
3 changed files with 14 additions and 0 deletions

View File

@ -249,6 +249,9 @@ void FortManager::showGraphWindow()
m_graphWindow = new GraphWindow();
m_graphWindowState->install(m_graphWindow);
connect(m_graphWindow, &GraphWindow::aboutToClose,
this, &FortManager::closeGraphWindow);
}
m_graphWindow->show();

View File

@ -32,3 +32,10 @@ void WidgetWindow::hideEvent(QHideEvent *event)
emit visibilityChanged();
}
void WidgetWindow::closeEvent(QCloseEvent *event)
{
emit aboutToClose();
QWidget::closeEvent(event);
}

View File

@ -16,12 +16,16 @@ signals:
void visibilityChanged();
void aboutToClose();
protected:
void moveEvent(QMoveEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;
void closeEvent(QCloseEvent *event) override;
};
#endif // WIDGETWINDOW_H