From 2c062546a21edc68ded82b7b852df3c993d332e0 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Sun, 26 Nov 2017 22:22:25 +0100 Subject: 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 Reviewed-by: Richard Moe Gustavsen --- src/plugins/styles/mac/qmacstyle_mac.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index c6ae7c1b79..2067c86023 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -596,8 +596,7 @@ static QString qt_mac_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) -- cgit v1.2.3