4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
24 DockView::DockView(GuiView & parent, QString const & name,
25 QString const & title, Qt::DockWidgetArea area,
26 Qt::WindowFlags flags)
27 : QDockWidget(&parent, flags), Dialog(parent, name, title)
30 parent.addDockWidget(area, this);
32 connect(&parent, SIGNAL(bufferViewChanged()),
33 this, SLOT(onBufferViewChanged()));
34 connect(this, SIGNAL(visibilityChanged(bool)),
35 &parent, SLOT(onDockWidgetVisibilityChanged()));
38 // Make dock widgets sub windows to prevent focusNextPrevChild
39 // (Tab key) switching to the parent rather than to the next
40 // widget in the pane (#12170)
41 setWindowFlags(Qt::SubWindow);
45 void DockView::keyPressEvent(QKeyEvent * ev)
47 if (ev->key() == Qt::Key_Escape) {
48 QMainWindow * mw = static_cast<QMainWindow *>(parent());
55 Qt::KeyboardModifiers mod = ev->modifiers();
56 if (mod & Qt::AltModifier) {
57 (setFloating(!isFloating()));
68 } // namespace frontend
71 #include "moc_DockView.cpp"