]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/CustomizedWidgets.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / CustomizedWidgets.h
1 // -*- C++ -*-
2 /**
3  * \file CustomizedWidgets.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Bo Peng
8  * \author Edwin Leuven
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef CUSTOMIZEDWIDGETS_H
14 #define CUSTOMIZEDWIDGETS_H
15
16 #include <QLineEdit>
17 #include "KeySequence.h"
18
19 class QEvent;
20 class QKeyEvent;
21
22 namespace lyx {
23 namespace frontend {
24
25 /**
26  * A lineedit for inputting shortcuts
27  */
28 class ShortcutLineEdit : public QLineEdit {
29         Q_OBJECT
30 public:
31         ShortcutLineEdit(QWidget * parent);
32         void reset();
33         bool eventFilter(QObject*, QEvent* e );
34         lyx::KeySequence const getKeySequence() const;
35 protected Q_SLOTS:
36         bool event(QEvent* e);
37         void keyPressEvent(QKeyEvent * e);
38 private:
39         void appendToSequence(QKeyEvent * e);
40         lyx::KeySequence keysequence_;
41         bool has_cursor_;
42 };
43
44 } // namespace frontend
45 } // namespace lyx
46
47 #endif // CUSTOMIZEDWIDGETS_H