]> Shamusworld >> Repos - architektonas/blob - src/widgets/qg_commandedit.h
5cc6287e3b19ef920024fdb54dc40d56eb5bb774
[architektonas] / src / widgets / qg_commandedit.h
1 #ifndef QG_COMMANDEDIT_H
2 #define QG_COMMANDEDIT_H
3
4 #include <QtGui>
5
6 /**
7  * A command line edit with some typical console features
8  * (uparrow for the history, tab, ..).
9  */
10 class QG_CommandEdit: public QLineEdit
11 {
12         Q_OBJECT
13
14         public:
15                 QG_CommandEdit(QWidget * parent = 0, const char * name = 0);
16                 virtual ~QG_CommandEdit();
17
18         protected:
19                 virtual bool event(QEvent * e);
20                 virtual void keyPressEvent(QKeyEvent * e);
21                 virtual void focusInEvent(QFocusEvent * e);
22                 virtual void focusOutEvent(QFocusEvent * e);
23
24         signals:
25                 void tabPressed();
26                 void escape();
27                 void focusIn();
28                 void focusOut();
29
30         private:
31                 QStringList historyList;
32                 QStringList::Iterator it;
33                 bool acceptCoordinates;
34 };
35
36 #endif