From d2d02a1f08d0d9dd114e98cbefbf7d18408c1cd0 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 1 May 2014 22:57:07 +0000 Subject: [PATCH] Fixed bug entering shortcuts with shift+number. --- qt/lc_qpreferencesdialog.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 6fa1d1bd..e077c499 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -419,7 +419,8 @@ bool lcQPreferencesDialog::eventFilter(QObject *object, QEvent *event) return true; Qt::KeyboardModifiers state = keyEvent->modifiers(); - if (state & Qt::ShiftModifier) + QString text = QKeySequence(nextKey).toString(); + if ((state & Qt::ShiftModifier) && (text.isEmpty() || !text.at(0).isPrint() || text.at(0).isLetter() || text.at(0).isSpace())) nextKey |= Qt::SHIFT; if (state & Qt::ControlModifier) nextKey |= Qt::CTRL; @@ -435,10 +436,7 @@ bool lcQPreferencesDialog::eventFilter(QObject *object, QEvent *event) return true; } - if (event->type() == QEvent::Shortcut || event->type() == QEvent::KeyRelease) - return true; - - if (event->type() == QEvent::ShortcutOverride) + if (event->type() == QEvent::Shortcut || event->type() == QEvent::KeyRelease || event->type() == QEvent::ShortcutOverride) { event->accept(); return true;