From f6a2925331bf53f0f77c73fc805ab918bce59ec2 Mon Sep 17 00:00:00 2001 From: Jookia <166291@gmail.com> Date: Sun, 22 Mar 2015 19:09:26 +1100 Subject: [PATCH] Tabs with modifiers are passed up from chat boxes. In Qt chat boxes filter out events related to text editing, including tabs. Unfortunately tabs with modifiers like those used to cycle through contacts are being filtered despite not being used for anything. This fixes the keybind for cycling forward through contacts (Ctrl+Tab). --- src/widget/tool/chattextedit.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/widget/tool/chattextedit.cpp b/src/widget/tool/chattextedit.cpp index 08526fc5b..46cd72ff2 100644 --- a/src/widget/tool/chattextedit.cpp +++ b/src/widget/tool/chattextedit.cpp @@ -25,12 +25,17 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) : } void ChatTextEdit::keyPressEvent(QKeyEvent * event) -{ +{ int key = event->key(); if ((key == Qt::Key_Enter || key == Qt::Key_Return) && !(event->modifiers() & Qt::ShiftModifier)) emit enterPressed(); else if (key == Qt::Key_Tab) - emit tabPressed(); + { + if (event->modifiers()) + event->ignore(); + else + emit tabPressed(); + } else if (key == Qt::Key_Up && this->toPlainText().isEmpty()) { this->setText(lastMessage);