Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.10.1, 5.11.1
-
None
-
-
d83441340c (qt/qtbase/dev) d83441340c (qt/tqtc-qtbase/dev)
Description
Summary:
QKeySequence::toString() returns garbage strings for some simple QKeySequence like Qt::Key_Shift, Qt::Key_Control, Qt::Key_Mode_switch, ... The issue can be reproduced on macOS 10.13.6 as well as on Windows 10.
Steps to reproduce (macOS):
- Download the attached application GarbageKeySequenceDescription: GarbageKeySequenceDescription.zip
- Compile the application on macOS 10.13.6 and run it
Result: You see garbage strings for Key_Shift, Key_Control and Key_Mode_switch:
Key_Left: portableKey: "Left" nativeKey: "←" Key_Shift: portableKey: "ៀ\uDC20" nativeKey: "⇧" Key_Control: portableKey: "ៀ\uDC21" nativeKey: "⌘" Key_Mode_switch: portableKey: "ោ\uDD7E" nativeKey: "ោ\uDD7E"
Steps to reproduce (Windows 10):
- Download the attached application GarbageKeySequenceDescription:
- Compile the application on Windows 10 and run it
Result: You see garbage strings for Key_Shift, Key_Control and Key_Mode_switch:
Key_Left: portableKey: "Left" nativeKey: "Left" Key_Shift: portableKey: "?\uDC20" nativeKey: "?\uDC20" Key_Control: portableKey: "?\uDC21" nativeKey: "?\uDC21" Key_Mode_switch: portableKey: "?\uDD7E" nativeKey: "?\uDD7E"
More information:
The code simply does the following:
QString nativeKey = QKeySequence(Qt::Key_Shift).toString(QKeySequence::NativeText);
qDebug() << "nativeKey: " << nativeKey;
Expected:
QKeySequence::toString() should never return a garbage string. It should return an empty string if it can't provide a valid description.
Attachments
Issue Links
- relates to
-
QTBUG-62102 QKeySequenceEdit handles meta keys incorrectly on Wayland
- Closed
-
QTBUG-40030 Special keys like Shift are not named in QKeySequence::toString.
- Closed
-
QTBUG-111992 QKeySequenceEdit can't register shortcuts with dead keys
- Reported
-
QTBUG-4022 QKeySequence::toString() returns gibberish for Qt::KeypadModifier
- Closed
For Gerrit Dashboard: QTBUG-69715 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
411073,18 | QKeySequence: Add missing modifier names | dev | qt/qtbase | Status: MERGED | +2 | 0 |