]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DockView.h
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / DockView.h
index 2ff08f63e2019937ae8c4eff1861f3ae38ac68ea..1024bb50fd6636d1ff34a5079abb7b5cc488eb90 100644 (file)
@@ -16,6 +16,7 @@
 #include "GuiView.h"
 
 #include <QDockWidget>
+#include <QKeyEvent>
 
 namespace lyx {
 namespace frontend {
@@ -51,10 +52,24 @@ public:
        /// We don't want to restore geometry session for dock widgets.
        void restoreSession() {}
 
+       void keyPressEvent(QKeyEvent * ev)
+       {
+               if (ev->key() == Qt::Key_Escape) {
+                       QMainWindow * mw = static_cast<QMainWindow *>(parent());
+                       if (!mw) {
+                               ev->ignore();
+                               return;
+                       }
+                       mw->activateWindow();
+                       mw->setFocus();
+                       ev->accept();
+               }
+       }
        /// Dialog inherited methods
        //@{
        void applyView() {}
        bool isClosing() const { return false; }
+       bool needBufferOpen() const { return false; }
        //@}
 };