author | wazlaf <wazlaf> | 2002-10-15 10:11:31 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-10-15 10:11:31 (UTC) |
commit | e09b7ab685d29eba947c3bb021192408acae70be (patch) (side-by-side diff) | |
tree | 5adf52c8d56819aab0daed8e7da189110276e90a /noncore/net/opieirc/ircmisc.cpp | |
parent | 31a73cafb40fffe2bbc12bb6fd0df6dc254d6646 (diff) | |
download | opie-e09b7ab685d29eba947c3bb021192408acae70be.zip opie-e09b7ab685d29eba947c3bb021192408acae70be.tar.gz opie-e09b7ab685d29eba947c3bb021192408acae70be.tar.bz2 |
some qwhatsthis introduced, the IRCHistoryLineEdit now catches tabs
Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmisc.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp index 2e7f316..c8e6190 100644 --- a/noncore/net/opieirc/ircmisc.cpp +++ b/noncore/net/opieirc/ircmisc.cpp @@ -66,16 +66,17 @@ IRCTabWidget::IRCTabWidget(QWidget *parent, const char *name) : QTabWidget(paren void IRCTabWidget::setTabColor(int index, QColor color) { ((IRCTabBar *)tabBar())->setTabColor(index, color); } IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) { m_index = -1; + installEventFilter(this); } void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { int key = event->key(); if (key == Key_Up) { if (m_history.count() > 0 && m_index < (signed int)m_history.count()-1) { m_index++; setText(m_history[m_index]); @@ -87,11 +88,26 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { } if (m_index == 0) { m_index = -1; setText(""); } } else if (key == Key_Return) { m_history.prepend(text()); m_index = -1; + } else if (key == Key_Tab) { + printf("got tab\n"); + return; } QLineEdit::keyPressEvent(event); } + +bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) { + if (event->type() == QEvent::KeyPress) { + QKeyEvent *k = (QKeyEvent *) event; + /* Catch tab characters */ + if (k->key() == Key_Tab) { + qDebug("tab!"); + return TRUE; + } + } + return QLineEdit::eventFilter(object, event); +} |