Fix a bug with Shift+3 in the ShortcutEdit (thanks gzfuqun!)
This commit is contained in:
parent
f0712b4988
commit
1b09ed07a6
|
@ -51,10 +51,11 @@ void ShortcutEdit::keyPressEvent(QKeyEvent* event)
|
|||
QString text = event->text();
|
||||
// The shift modifier only counts when it is not used to type a symbol
|
||||
// that is only reachable using the shift key anyway
|
||||
if(modifiers.testFlag(Qt::ShiftModifier) && (text.isEmpty() ||
|
||||
!text.at(0).isPrint() ||
|
||||
text.at(0).isLetterOrNumber() ||
|
||||
text.at(0).isSpace()))
|
||||
// Fix from: https://bbs.pediy.com/thread-270394.htm
|
||||
if(modifiers.testFlag(Qt::ShiftModifier) && (
|
||||
((keyInt >= Qt::Key_Exclam) && (keyInt <= Qt::Key_Slash)) ||
|
||||
((keyInt >= Qt::Key_Colon) && (keyInt <= Qt::Key_At)) ||
|
||||
((keyInt >= Qt::Key_BracketLeft) && (keyInt <= Qt::Key_QuoteLeft))))
|
||||
keyInt += Qt::SHIFT;
|
||||
if(modifiers.testFlag(Qt::ControlModifier))
|
||||
keyInt += Qt::CTRL;
|
||||
|
|
Loading…
Reference in New Issue