diff --git a/src/widgets/ddialog.cpp b/src/widgets/ddialog.cpp index 026a5f779..e44764e8d 100644 --- a/src/widgets/ddialog.cpp +++ b/src/widgets/ddialog.cpp @@ -996,10 +996,17 @@ void DDialog::showEvent(QShowEvent *event) /*!\reimp */ void DDialog::hideEvent(QHideEvent *event) { - Q_EMIT aboutToClose(); - DAbstractDialog::hideEvent(event); + Q_EMIT visibleChanged(isVisible()); +} + +void DDialog::closeEvent(QCloseEvent *event) +{ + Q_UNUSED(event) + + Q_EMIT aboutToClose(); + done(-1); Q_EMIT visibleChanged(isVisible()); diff --git a/src/widgets/ddialog.h b/src/widgets/ddialog.h index 4d8806b99..ee9ee083d 100644 --- a/src/widgets/ddialog.h +++ b/src/widgets/ddialog.h @@ -116,6 +116,7 @@ public Q_SLOTS: void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *event) override; void childEvent(QChildEvent *event) Q_DECL_OVERRIDE; void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;