Forms: Use QHideEvent instead of QCloseEvent

QCloseEvent is the wrong event to use here. If the `Ok` button is
pressed for example, QCloseEvent is not emitted. QHideEvent is
always called when the dialog is hidden.
This commit is contained in:
tt2468 2021-09-17 03:00:33 -07:00
parent a4e62acf25
commit 342164dfb5
2 changed files with 4 additions and 2 deletions

View File

@ -90,8 +90,10 @@ void SettingsDialog::showEvent(QShowEvent *event)
sessionTableTimer->start(1000);
}
void SettingsDialog::closeEvent(QCloseEvent *event)
void SettingsDialog::hideEvent(QHideEvent *event)
{
UNUSED_PARAMETER(event);
if (sessionTableTimer->isActive())
sessionTableTimer->stop();

View File

@ -16,7 +16,7 @@ public:
explicit SettingsDialog(QWidget* parent = 0);
~SettingsDialog();
void showEvent(QShowEvent *event);
void closeEvent(QCloseEvent *event);
void hideEvent(QHideEvent *event);
void ToggleShowHide();
private Q_SLOTS: