Help menu item not showing
-
Using Designer, I created a main window with a Help menu item.
When I ran it on Linux, I can see the Help menu but when I ran the same code on MacOS, I don't see the Help menu.
I tried reading the following to understand about global menu but am unable to follow what needs to be done
https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QMenuBar.html#qmenubar-as-a-global-menu-bar
It says I need to name my widget with "about.*" but that will make my help button read funny to the user.
My code is here
https://github.com/nyue/QtQuestions/tree/main/PySide2/macos_menu_about
-
See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum
-
Using Designer, I created a main window with a Help menu item.
When I ran it on Linux, I can see the Help menu but when I ran the same code on MacOS, I don't see the Help menu.
I tried reading the following to understand about global menu but am unable to follow what needs to be done
https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QMenuBar.html#qmenubar-as-a-global-menu-bar
It says I need to name my widget with "about.*" but that will make my help button read funny to the user.
My code is here
https://github.com/nyue/QtQuestions/tree/main/PySide2/macos_menu_about
@nicholas_yue Why do you set the geometry of the menu bar? That should be up to the OS:
self.menubar.setGeometry(QRect(0, 0, 800, 22))
On MacOS the menu bar is not in the application window but in the top bar of the screen. It is not there for your application?
-
@nicholas_yue Why do you set the geometry of the menu bar? That should be up to the OS:
self.menubar.setGeometry(QRect(0, 0, 800, 22))
On MacOS the menu bar is not in the application window but in the top bar of the screen. It is not there for your application?
@jsulm Great question. The code is generated by UIC so the folks at Qt might be in a better knowledge position to answer that.
-
@jsulm Great question. The code is generated by UIC so the folks at Qt might be in a better knowledge position to answer that.
@nicholas_yue What about my second question?
-
@nicholas_yue What about my second question?
@jsulm Just launched and checked again. No, it is not there in the top. Only the "File" menu is there.
As expected, the Quit item has been moved from File as per the documentation for Global Menu Bar but no Help menu.
I believe there is a way to hint Qt to pass the menu item in Help for MacOS to do the right thing and place it at a place that adhere to MacOS UI convention. I am just having difficult understanding and digesting the information in the documentation to get it right.
I am pretty sure I need to do some additional steps but just not sure what is required even after reading the documentation.
-
See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum
-
See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum
-
N nicholas_yue has marked this topic as solved on