X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FDialogView.h;h=a95b1a435cd910141d5557a5e5b7ac7c314c7ece;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=8bcec53e2b783ffb7f44b0482403dfc4bf5d06a5;hpb=5fe7778d28b8cb936b648e434a5430bc3ce50b7a;p=lyx.git diff --git a/src/frontends/qt4/DialogView.h b/src/frontends/qt4/DialogView.h index 8bcec53e2b..a95b1a435c 100644 --- a/src/frontends/qt4/DialogView.h +++ b/src/frontends/qt4/DialogView.h @@ -21,9 +21,6 @@ namespace lyx { namespace frontend { -/** \c Dialog collects the different parts of a Model-Controller-View - * split of a generic dialog together. - */ class DialogView : public QDialog, public Dialog { public: @@ -39,18 +36,28 @@ public: virtual QWidget const * asQWidget() const { return this; } protected: - /// Dialog inherited methods + /// \name Dialog inherited methods //@{ void applyView() {} bool initialiseParams(std::string const & /*data*/) { return true; } void clearParams() {} //@} + /// Any dialog that overrides this method should make sure to call it. void closeEvent(QCloseEvent * ev) { clearParams(); Dialog::disconnect(); ev->accept(); } + /// Any dialog that overrides this method should make sure to call it. + void hideEvent(QHideEvent * ev) + { + if (!ev->spontaneous()) { + clearParams(); + Dialog::disconnect(); + ev->accept(); + } + } }; } // namespace frontend