3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/22/2010 Added this text. :-)
17 #include "commandedit.h"
22 * Default Constructor. You must call init manually if you choose
23 * to use this constructor.
25 CommandEdit::CommandEdit(QWidget * parent, const char */*name*/):
26 // QLineEdit(parent, name)
34 CommandEdit::~CommandEdit()
40 * Bypass for key press events from the tab key.
42 bool CommandEdit::event(QEvent * e)
44 if (e->type() == QEvent::KeyPress)
46 QKeyEvent * k = (QKeyEvent *)e;
48 if (k->key() == Qt::Key_Tab)
55 return QLineEdit::event(e);
59 * History (arrow key up/down) support, tab.
61 void CommandEdit::keyPressEvent(QKeyEvent * e)
66 #warning "!!! URG !!!"
67 // if (it != historyList.begin() && it != 0)
68 if (it != historyList.begin())// && it != 0)
76 #warning "!!! URG !!!"
77 // if (it != historyList.end() && it != 0)
78 if (it != historyList.end())// && it != 0)
82 if (it != historyList.end())
90 historyList.append(text());
91 it = historyList.end();
92 QLineEdit::keyPressEvent(e);
103 QLineEdit::keyPressEvent(e);
108 void CommandEdit::focusInEvent(QFocusEvent * e)
111 QLineEdit::focusInEvent(e);
115 void CommandEdit::focusOutEvent(QFocusEvent * e)
118 QLineEdit::focusOutEvent(e);