From 91ec6b19883cd64231a69c2df7fbc3a0d641576d Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Fri, 28 May 2021 10:49:41 +0200 Subject: QWidgetTextControl: ignore GroupSwitchModifier for BackSpace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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 Change-Id: I7251963d41a70d61800d25e43d5012b859693f69 Reviewed-by: Liang Qi Reviewed-by: Morten Johan Sørvig (cherry picked from commit 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qwidgettextcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 4fa38b82c4..5f307328a4 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()) { -- cgit v1.2.3