summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircmisc.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmisc.cpp16
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
@@ -68,12 +68,13 @@ 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) {
@@ -89,9 +90,24 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
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);
+}