]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DockView.h
More GuiInfo usability work
[lyx.git] / src / frontends / qt4 / DockView.h
index 1024bb50fd6636d1ff34a5079abb7b5cc488eb90..3c54c2ad20c0dbc06963abe972e5bfcffc926dee 100644 (file)
@@ -29,20 +29,16 @@ namespace frontend {
  **/
 class DockView : public QDockWidget, public Dialog
 {
+       Q_OBJECT
+
 public:
-       DockView(
-               GuiView & parent, ///< the main window where to dock.
-               QString const & name, ///< dialog identifier.
-               QString const & title, ///< dialog title.
-               Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
-               Qt::WindowFlags flags = 0
-       )
-               : QDockWidget(&parent, flags), Dialog(parent, name, title)
-       {
-               setObjectName(name);
-               parent.addDockWidget(area, this);
-               hide();
-       }
+       DockView(GuiView & parent, ///< the main window where to dock.
+                QString const & name, ///< dialog identifier.
+                QString const & title, ///< dialog title.
+                Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of
+                                                                                                                          ///the dock (and
+                                                                                                                          ///also drawer)
+                Qt::WindowFlags flags = 0);
 
        virtual ~DockView() {}
 
@@ -52,28 +48,20 @@ 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();
-               }
-       }
+       void keyPressEvent(QKeyEvent * ev);
+
        /// Dialog inherited methods
        //@{
        void applyView() {}
        bool isClosing() const { return false; }
        bool needBufferOpen() const { return false; }
        //@}
+
+protected Q_SLOTS:
+       void onBufferViewChanged() {} //override
 };
 
-} // frontend
-} // lyx
+} // namespace frontend
+} // namespace lyx
 
 #endif // DOCK_VIEW_H