Don't try to create a QChar from a non-char key enum

Asserts with Qt 6. Instead, check with the static QChar::isLetter, that
handles invalid input properly.
This commit is contained in:
Volker Krause 2022-09-29 17:47:22 +02:00
parent 25a2c0a9e8
commit 2bda46d5b9

View file

@ -505,7 +505,7 @@ Qt::KeyboardModifiers Xkb::modifiersRelevantForGlobalShortcuts(uint32_t scanCode
// in that case the shift should be removed from the consumed modifiers again
// otherwise it would not be possible to trigger e.g. Shift+W as a shortcut
// see BUG: 370341
if (QChar(toQtKey(m_keysym, scanCode, Qt::ControlModifier)).isLetter()) {
if (QChar::isLetter(toQtKey(m_keysym, scanCode, Qt::ControlModifier))) {
consumedMods = Qt::KeyboardModifiers();
}
}