<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PySide6 QMenuBar Issue on MacOS]]></title><description><![CDATA[<p dir="auto">I developed a PySide6 app in VS Code on Windows and let GitHub Actions make MacOS executables. Everything works very well, except that the QMenuBar doesn't work on MacOS. It doesn't show all the actions/submenus. I don't know much about development for MacOS. Any advice most appreciated!</p>
<p dir="auto">Code snippet:</p>
<pre><code>class CustomMenuBar(QMenuBar):
    def __init__(self, view, app, experiment_controller):
        super().__init__()
        self.view = view
        self.app = app
        self.experiment_controller = experiment_controller
        file_menu = self.addMenu("Application")
        quit_action = file_menu.addAction("Quit")
        quit_action.triggered.connect(self.quit_app)
        
        experiment_menu = self.addMenu("Experiment")
        open_experiment_action = experiment_menu.addAction("Open Experiment File")
        open_experiment_action.triggered.connect(self.load_experiment_file)
        exp_submenu = QMenu("Configure Experiment", self)
        experiment_menu.addMenu(exp_submenu)
        create_new_exp_action = QAction("Create new experiment", self)
        exp_submenu.addAction(create_new_exp_action)
        create_new_exp_action.triggered.connect(self.show_blank_experiment_configuration_form)
        experiment_menu.addMenu(exp_submenu)
        edit_current_exp_action = QAction("Edit current experiment", self)
        exp_submenu.addAction(edit_current_exp_action)
        edit_current_exp_action.triggered.connect(self.show_loaded_experiment_configuration_form)
        close_experiment_action = experiment_menu.addAction("Close Experiment")
        close_experiment_action.triggered.connect(self.close_experiment)
        save_experiment_action = experiment_menu.addAction("Save Current")
        save_experiment_action.triggered.connect(self.save_experiment)

        help_menu = self.addMenu("Help")
        welcome_action = help_menu.addAction("Welcome")
        welcome_action.triggered.connect(self.show_welcome)
        manual_action = help_menu.addAction("User's Manual")
        manual_action.triggered.connect(self.show_manual)

        new_submenu = QMenu("Theme", self)
        help_menu.addMenu(new_submenu)
        dark_theme_action = QAction("Dark", self)
        new_submenu.addAction(dark_theme_action)
        dark_theme_action.triggered.connect(self.set_dark_theme)

        light_theme_action = QAction("Light", self)
        new_submenu.addAction(light_theme_action)
        light_theme_action.triggered.connect(self.set_light_theme)
</code></pre>
<p dir="auto">Pictures of how the code works well on Windows:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/e6e510f0-3f7b-4323-8a8b-d3577d3e4be0.png" alt="menubar1.png" class=" img-fluid img-markdown" /><br />
<img src="https://ddgobkiprc33d.cloudfront.net/d681bb78-159c-436c-9014-3195a8643bce.png" alt="menubar2.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">On MacOS, the QMenuBar items get pushed up into the MacOS menu bar itself. But the Experiment-&gt;Configure Experiment submenu does not appear, and the Application menu does not appear. The help-&gt;Theme-&gt;Dark/Light do appear, so the issue isn't specific to side-submenus.</p>
<p dir="auto">I tried</p>
<pre><code>setNativeMenuBar(False)
</code></pre>
<p dir="auto">but it only made the entire menu bar vanish.</p>
<p dir="auto">If this menu bar is just not workable on MacOS, I will have to remove the menu bar and use buttons/popups.</p>
<p dir="auto">Many thanks for any tips.</p>
]]></description><link>https://forum.qt.io/topic/164570/pyside6-qmenubar-issue-on-macos</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 12:29:32 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164570.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Apr 2026 19:09:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PySide6 QMenuBar Issue on MacOS on Fri, 17 Apr 2026 20:21:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">macOS has certain rules (as other OS do as well) to have a consistent user experience and Qt helps to put things into the right place automatically.<br />
For example, the settings are under Preferences in the application's name menu. User don't have to hunt down for these kind of things.</p>
<p dir="auto">On macOS the default QMainWindow menu bar is indeed at the top of the screen which is normal and expected.</p>
<p dir="auto">Taking a look at your code and the picture you posted, I would suggest to redesign things a bit. For example, having the dark/light theme switch under Help is rather unexpected.</p>
]]></description><link>https://forum.qt.io/post/837840</link><guid isPermaLink="true">https://forum.qt.io/post/837840</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 17 Apr 2026 20:21:58 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 QMenuBar Issue on MacOS on Thu, 16 Apr 2026 23:58:05 GMT]]></title><description><![CDATA[<p dir="auto">So, MacOS decides whether an apps menu bar goes into the MacOS menu bar based on the semantics of strings? Wow. (There is an out: setNativeMenuBar(False), but it didn't work for me.)</p>
<p dir="auto">I'd love to hear from any experts about this.</p>
]]></description><link>https://forum.qt.io/post/837803</link><guid isPermaLink="true">https://forum.qt.io/post/837803</guid><dc:creator><![CDATA[JimRyan]]></dc:creator><pubDate>Thu, 16 Apr 2026 23:58:05 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 QMenuBar Issue on MacOS on Thu, 16 Apr 2026 23:18:42 GMT]]></title><description><![CDATA[<p dir="auto">SOLVED. There may be other solutions, but my solution was a semantic one. I got rid of strings that sound like menu items: configure, close, and edit. I also removed the Application menu, since Quit was likely to trigger the OS to put the menu in the MacOS menu bar.</p>
<p dir="auto">Perhaps only removing the application menu was necessary. Anyway, it's fixed.</p>
]]></description><link>https://forum.qt.io/post/837802</link><guid isPermaLink="true">https://forum.qt.io/post/837802</guid><dc:creator><![CDATA[JimRyan]]></dc:creator><pubDate>Thu, 16 Apr 2026 23:18:42 GMT</pubDate></item></channel></rss>