]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/CustomizedWidgets.h
cb01094446c21f43ab671a3f24857a08cc7d22e2
[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 <QEvent>
17 #include <QCloseEvent>
18 #include <QLineEdit>
19
20 /**
21  * A lineedit for inputting shortcuts
22  */
23 class ShortcutLineEdit : public QLineEdit {
24         Q_OBJECT
25 public:
26         ShortcutLineEdit(QWidget * parent) : QLineEdit(parent) {}
27 protected Q_SLOTS:
28         void keyPressEvent(QKeyEvent * e);
29         bool event(QEvent * e);
30 };
31
32
33 /**
34   * A lineedit that displays a hint message when there is no
35   * text and not under focus.
36   */
37 class SearchLineEdit : public QLineEdit {
38         Q_OBJECT
39 public:
40         QString const hintMessage() const;
41         SearchLineEdit(QWidget * parent) : QLineEdit(parent) {}
42 protected Q_SLOTS:
43         void focusInEvent(QFocusEvent * e);
44         void focusOutEvent(QFocusEvent * e);
45 };
46
47
48 #endif // CUSTOMIZEDWIDGETS_H