Browse Source

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).
pull/1464/merge
Jookia 10 years ago committed by tux3
parent
commit
f6a2925331
  1. 9
      src/widget/tool/chattextedit.cpp

9
src/widget/tool/chattextedit.cpp

@ -25,12 +25,17 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) : @@ -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);

Loading…
Cancel
Save