]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/DialogView.cpp
Fix completion in math when inline completion was not yet shown
[lyx.git] / src / frontends / qt / DialogView.cpp
1 // -*- C++ -*-
2 /**
3  * \file DialogView.cpp
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "DialogView.h"
15 #include "GuiView.h"
16
17 #include <QCloseEvent>
18
19
20 namespace lyx {
21 namespace frontend {
22
23 DialogView::DialogView(GuiView & lv, QString const & name, QString const & title)
24         : QDialog(&lv), Dialog(lv, name, title)
25 {
26         connect(&lv, SIGNAL(bufferViewChanged()),
27                 this, SLOT(onBufferViewChanged()));
28
29         // remove question marks from Windows dialogs
30         setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
31 }
32
33
34 void DialogView::closeEvent(QCloseEvent * ev)
35 {
36         clearParams();
37         Dialog::disconnect();
38         ev->accept();
39 }
40
41
42 void DialogView::hideEvent(QHideEvent * ev)
43 {
44         if (!ev->spontaneous()) {
45                 clearParams();
46                 Dialog::disconnect();
47                 ev->accept();
48         }
49 }
50
51 } // namespace frontend
52 } // namespace lyx
53
54 #include "moc_DialogView.cpp"