diff options
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-02-10 16:49:38 +0100 |
|---|---|---|
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-02-11 23:23:28 +0100 |
| commit | 0835537c3c3a8b7991b7a6e4a877a13f165a66e7 (patch) | |
| tree | c4b464bd6f157855b5f5ef0cb9482504f2a8ba9a /src/plugins/sqldrivers/mysql/qsql_mysql.cpp | |
| parent | f11e5435c776deddf27f7759180c1d41f64b8cce (diff) | |
macOS: map Qt::Key_Return to NSCarriageReturnCharacter in menus
On macOS, key combinations with the Return key do not get delivered
through NSView::keyDown, but they are seen by the
QCocoaNSMenu::menuHasKeyEquivalent override. We already use that
override to check whether any menu item uses a matching shortcut, and
give Qt's focus object a chance to override the shortcut. The key
mapper used the NSNewlineCharacter '\n' for Qt::Key_Return.
However, the character we get from macOS for the return key is the
NSCarriageReturnCharacter character, '\r'. This makes the lookup
fail, and shortcut overrides are not delivered for shortcuts using
Qt::Key_Return.
To fix this, map Qt::Key_Return to NSCarriageReturnCharacter. The
inverse mapping maps both NSCarriageReturnCharacter and
NSNewlineCharacter to Qt::Key_Return, and there are no other users
of this function in Qt.
Pick-to: 6.5 6.4
Fixes: QTBUG-107526
Change-Id: I716190adf3cd94697e2b3ad1afc25b95d8ebde25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions
