Priority: P3: Somewhat important
Affects Version/s: 5.15.3
Fix Version/s: None
Component/s: GUI: Menus
Environment:iMac Pro (2017) running Big Sur 11.2.3; Qt 5.15.3
Our application creates QMenu objects and calls addAction and addSeparator as appropriate. Then it hides all actions, including the separators. We have logic that decides which actions and separators we want to show and then call setVisible( true ) on them.
I've attached source code for a simple test app I've run on Mac (Big Sur). Build and run the app. A MainWindow opens. Pull-down the Edit menu on system menu bar. You'll see a checkable and checked item named "Show Other Actions." Below it are several menu items. Note that two menu separators are present.
Now click "Show Other Actions" and re-open the Edit menu. All the menu items below it, including the two separators, are hidden.
Now click "Show Other Actions" and re-open the Edit menu again. The separator that used to be between "Redo" and "Cut" is NOT shown, but the second separator is.
You can view the qDebug output and should see this:
Hiding "Select All"
Hiding "Select Range"
Hiding "Invert Selection"
Showing "Select All"
Showing "Select Range"
Showing "Invert Selection"
We are clearly requesting both separators be shown, but that's not what's happening.
In our real-world application, we suspect this bug is causing other strangeness such as showing separators between the wrong items, e.g., between "Cut" and "Copy" instead of between "Redo" and "Cut."