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();
|
QString text = event->text();
|
||||||
// The shift modifier only counts when it is not used to type a symbol
|
// The shift modifier only counts when it is not used to type a symbol
|
||||||
// that is only reachable using the shift key anyway
|
// that is only reachable using the shift key anyway
|
||||||
if(modifiers.testFlag(Qt::ShiftModifier) && (text.isEmpty() ||
|
// Fix from: https://bbs.pediy.com/thread-270394.htm
|
||||||
!text.at(0).isPrint() ||
|
if(modifiers.testFlag(Qt::ShiftModifier) && (
|
||||||
text.at(0).isLetterOrNumber() ||
|
((keyInt >= Qt::Key_Exclam) && (keyInt <= Qt::Key_Slash)) ||
|
||||||
text.at(0).isSpace()))
|
((keyInt >= Qt::Key_Colon) && (keyInt <= Qt::Key_At)) ||
|
||||||
|
((keyInt >= Qt::Key_BracketLeft) && (keyInt <= Qt::Key_QuoteLeft))))
|
||||||
keyInt += Qt::SHIFT;
|
keyInt += Qt::SHIFT;
|
||||||
if(modifiers.testFlag(Qt::ControlModifier))
|
if(modifiers.testFlag(Qt::ControlModifier))
|
||||||
keyInt += Qt::CTRL;
|
keyInt += Qt::CTRL;
|
||||||
|
|
Loading…
Reference in New Issue