diff options
author | Igor Kushnir <igorkuo@gmail.com> | 2021-05-28 10:49:41 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2021-05-31 14:42:05 +0000 |
commit | 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8 (patch) | |
tree | c83a52fbb314c60daab05b11b2f34528d8f14923 /src/widgets | |
parent | c4b5e84e9e112fab25301f80806e8c66f418594f (diff) |
QWidgetTextControl: ignore GroupSwitchModifier for BackSpace
"The keypad and group switch modifier should not make a difference" when matches a QKeySequence, see QKeyEvent::matches() implementation.
Qt(xcb) treats AltGr as GroupSwitchModifier in hard code, which should
come from Qt 4 era. Nowadays, with different xkb setups, Mode_switch
could be different keys. When it is AltGr, Qt will get AltGr as
GroupSwitchModifier. When it is not AltGr, another key like
Less/Greaterkey(details in bug report), GroupSwitchModifier will not
be set in the case.
Fixes: QTBUG-36565
Pick-to: 5.15 6.0 6.1
Change-Id: I7251963d41a70d61800d25e43d5012b859693f69
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index c9c4c848fc..b9ed4f6c04 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1282,7 +1282,7 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e) // example) repaintSelection(); - if (e->key() == Qt::Key_Backspace && !(e->modifiers() & ~Qt::ShiftModifier)) { + if (e->key() == Qt::Key_Backspace && !(e->modifiers() & ~(Qt::ShiftModifier | Qt::GroupSwitchModifier))) { QTextBlockFormat blockFmt = cursor.blockFormat(); QTextList *list = cursor.currentList(); if (list && cursor.atBlockStart() && !cursor.hasSelection()) { |