Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.1, 5.10.0 Alpha
-
macOS 10.12, 10.11
-
-
2c062546a21edc68ded82b7b852df3c993d332e0
Description
On macOS: If the text of a QAction contains multiple ampersands in a row only the first ampersand is removed as the text appears in the main menu. This behavior differs from how Windows handles ampersand in the same situation. On windows every other ampersand is removed. This is also how other widgets that utilize QActions and shortcuts, such as tabs, buttons etc., handle a string of multiple ampersands.
For example, this is how a string containing six ampersands in a row is handled:
Shortcut-utilizing widgets generally: &&&&&& -> &&&
QMenuBar/QMenu on Windows: &&&&&& -> &&&
QMenubar/QMenu on macOS: &&&&&& -> &&&&&
Steps to reproduce:
- Run the sample attached
- Click on the 'Test Menu' in the menu bar
- Look at the menu item revealed and compare the ampersand handling across the different widgets. (See the image attached)
EXPECTED: The menu item reads "One & , two && , three &&& , four , &&&& stop"
ACTUAL: The menu item reads "One & , two &&& , three &&&&& , four , &&&&&&& stop"
Attachments
Issue Links
- relates to
-
QTBUG-73087 ItemDelegate label always uses mnemonics
- Reported