2 #include "qg_commandedit.h"
7 * Default Constructor. You must call init manually if you choose
8 * to use this constructor.
10 QG_CommandEdit::QG_CommandEdit(QWidget * parent, const char */*name*/):
11 // QLineEdit(parent, name)
19 QG_CommandEdit::~QG_CommandEdit()
25 * Bypass for key press events from the tab key.
27 bool QG_CommandEdit::event(QEvent * e)
29 if (e->type() == QEvent::KeyPress)
31 QKeyEvent * k = (QKeyEvent *)e;
33 if (k->key() == Qt::Key_Tab)
40 return QLineEdit::event(e);
44 * History (arrow key up/down) support, tab.
46 void QG_CommandEdit::keyPressEvent(QKeyEvent * e)
51 #warning "!!! URG !!!"
52 // if (it != historyList.begin() && it != 0)
53 if (it != historyList.begin())// && it != 0)
61 #warning "!!! URG !!!"
62 // if (it != historyList.end() && it != 0)
63 if (it != historyList.end())// && it != 0)
67 if (it != historyList.end())
75 historyList.append(text());
76 it = historyList.end();
77 QLineEdit::keyPressEvent(e);
88 QLineEdit::keyPressEvent(e);
93 void QG_CommandEdit::focusInEvent(QFocusEvent * e)
96 QLineEdit::focusInEvent(e);
100 void QG_CommandEdit::focusOutEvent(QFocusEvent * e)
103 QLineEdit::focusOutEvent(e);