diff options
author | Andre de la Rocha <andre.rocha@qt.io> | 2017-11-26 22:22:25 +0100 |
---|---|---|
committer | Andre de la Rocha <andre.rocha@qt.io> | 2017-11-30 12:54:00 +0000 |
commit | 2c062546a21edc68ded82b7b852df3c993d332e0 (patch) | |
tree | 7de2c93f574ac801f31249e22e82d07b79056b69 /src/gui/kernel | |
parent | 0e5d1bb3e4182c16346856cc14576efa0dfda453 (diff) |
macOS: Fix handling of multiple ampersands in menu items
If the text of a QAction in a menu item contained a sequence of multiple
ampersand characters, only one of them would be removed, which is
inconsistent with the way this situation is handled on Windows, where
every other ampersand is removed, which is also the way other widgets
such as tabs, buttons, etc. are handled on macOS and other platforms.
Task-number: QTBUG-63361
Change-Id: Ibd9a520afa37b3387f3b951a94a3c275742e7ad3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index cd3966fb47..c8ba86bc9a 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -747,8 +747,7 @@ QString QPlatformTheme::removeMnemonics(const QString &original) int currPos = 0; int l = original.length(); while (l) { - if (original.at(currPos) == QLatin1Char('&') - && (l == 1 || original.at(currPos + 1) != QLatin1Char('&'))) { + if (original.at(currPos) == QLatin1Char('&')) { ++currPos; --l; if (l == 0) |