]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DialogView.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / DialogView.h
index 3901c769941ac8a4fe365e3e4c1723fea4aef383..a95b1a435cd910141d5557a5e5b7ac7c314c7ece 100644 (file)
@@ -36,7 +36,7 @@ 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; }
@@ -49,6 +49,15 @@ protected:
                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