diff --git a/ui/src/virtualconsole/vcscrollarea.cpp b/ui/src/virtualconsole/vcscrollarea.cpp index 587b5f1eec..e58cd0047a 100644 --- a/ui/src/virtualconsole/vcscrollarea.cpp +++ b/ui/src/virtualconsole/vcscrollarea.cpp @@ -10,9 +10,12 @@ VCScrollArea::VCScrollArea(QWidget *parent) : QScrollArea(parent) { void VCScrollArea::keyPressEvent(QKeyEvent *ev) { unsigned int keyCode = ev->key() | ev->modifiers(); QList::const_iterator it = std::find(m_overriddenKeyCodes.constBegin(), m_overriddenKeyCodes.constEnd(), keyCode); - if (it != m_overriddenKeyCodes.constEnd()) { + if (it != m_overriddenKeyCodes.constEnd()) + { ev->ignore(); - } else { + } + else + { QScrollArea::keyPressEvent(ev); } } @@ -29,8 +32,10 @@ bool VCScrollArea::needsOverride(const QKeySequence& ks) { void VCScrollArea::setKeyOverrides(const QList &keyOverrides) { m_overriddenKeyCodes.clear(); for (QList::const_iterator it = keyOverrides.constBegin(); - it != keyOverrides.constEnd(); ++it) { - if (needsOverride(*it)) { + it != keyOverrides.constEnd(); ++it) + { + if (needsOverride(*it)) + { // all our key sequences have only one key unsigned int keyCode = (*it)[0]; m_overriddenKeyCodes.append(keyCode); diff --git a/ui/src/virtualconsole/virtualconsole.cpp b/ui/src/virtualconsole/virtualconsole.cpp index cb34f3b0f7..fcfd5db09d 100644 --- a/ui/src/virtualconsole/virtualconsole.cpp +++ b/ui/src/virtualconsole/virtualconsole.cpp @@ -1776,10 +1776,11 @@ void VirtualConsole::enableKeyOverrides() { QList keySequencesToOverride; for (QHash::const_iterator it = m_widgetsMap.constBegin(); - it != m_widgetsMap.constEnd(); - ++it) { + it != m_widgetsMap.constEnd(); ++it) + { VCButton *btn = qobject_cast(*it); - if (btn) { + if (btn) + { keySequencesToOverride.append(btn->keySequence()); } }