Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.3
-
None
-
iMac Pro (2017) running Big Sur 11.2.3; Qt 5.15.3
Description
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 "Undo"
Hiding "Redo"
Hiding ""
Hiding "Cut"
Hiding "Copy"
Hiding "Paste"
Hiding "Delete"
Hiding ""
Hiding "Select All"
Hiding "Select Range"
Hiding "Invert Selection"
Showing "Undo"
Showing "Redo"
Showing ""
Showing "Cut"
Showing "Copy"
Showing "Paste"
Showing "Delete"
Showing ""
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."
Attachments
Issue Links
- relates to
-
QTBUG-88651 Can't Hide Menu Separator
- Closed