Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (show 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 | |||
@@ -71,6 +71,7 @@ void IRCTabWidget::setTabColor(int index, QColor color) { | |||
71 | 71 | ||
72 | IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) { | 72 | IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) { |
73 | m_index = -1; | 73 | m_index = -1; |
74 | installEventFilter(this); | ||
74 | } | 75 | } |
75 | 76 | ||
76 | void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { | 77 | void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { |
@@ -92,6 +93,21 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { | |||
92 | } else if (key == Key_Return) { | 93 | } else if (key == Key_Return) { |
93 | m_history.prepend(text()); | 94 | m_history.prepend(text()); |
94 | m_index = -1; | 95 | m_index = -1; |
96 | } else if (key == Key_Tab) { | ||
97 | printf("got tab\n"); | ||
98 | return; | ||
95 | } | 99 | } |
96 | QLineEdit::keyPressEvent(event); | 100 | QLineEdit::keyPressEvent(event); |
97 | } | 101 | } |
102 | |||
103 | bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) { | ||
104 | if (event->type() == QEvent::KeyPress) { | ||
105 | QKeyEvent *k = (QKeyEvent *) event; | ||
106 | /* Catch tab characters */ | ||
107 | if (k->key() == Key_Tab) { | ||
108 | qDebug("tab!"); | ||
109 | return TRUE; | ||
110 | } | ||
111 | } | ||
112 | return QLineEdit::eventFilter(object, event); | ||
113 | } | ||