1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Don't focus msg edit when non-text keys are pressed

Fixes #1829
This commit is contained in:
tux3 2015-06-07 17:05:55 +02:00
parent 98e91f90c3
commit bdec0557dc
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -257,7 +257,8 @@ bool GenericChatForm::event(QEvent* e)
if (e->type() == QEvent::KeyRelease && !msgEdit->hasFocus()) if (e->type() == QEvent::KeyRelease && !msgEdit->hasFocus())
{ {
QKeyEvent* ke = static_cast<QKeyEvent*>(e); QKeyEvent* ke = static_cast<QKeyEvent*>(e);
if (ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier) if ((ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier)
&& !ke->text().isEmpty())
msgEdit->setFocus(); msgEdit->setFocus();
} }
return QWidget::event(e); return QWidget::event(e);