Fixed crash when close main window.
This commit is contained in:
@@ -133,6 +133,12 @@ void MainWindow::showEvent(QShowEvent *evt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::closeEvent(QCloseEvent *evt)
|
||||||
|
{
|
||||||
|
Context::instance().destroy();
|
||||||
|
evt->accept();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionSettings_triggered()
|
void MainWindow::on_actionSettings_triggered()
|
||||||
{
|
{
|
||||||
SettingsForm *settings = new SettingsForm(this);
|
SettingsForm *settings = new SettingsForm(this);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
|
||||||
#include "logindialog.h"
|
#include "logindialog.h"
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ private:
|
|||||||
// QWidget interface
|
// QWidget interface
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *evt);
|
void showEvent(QShowEvent *evt);
|
||||||
|
void closeEvent(QCloseEvent *evt) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user