Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2934

PySide6: Native macOS Window menu items not automatically added

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.8.0.2
    • PySide
    • None
    • PySide6 version: 6.8.0.2
      Python version: 3.x
      OS: macOS
    • macOS

    Description

      When creating a Window menu in a PySide6 application on macOS, the native menu items (Minimize, Zoom, Bring All to Front, etc.) are not automatically added as they should be according to macOS Human Interface Guidelines. However, it does add native menu items for Edit and Help menus.

      According to Apple's Human Interface Guidelines (https://developer.apple.com/design/human-interface-guidelines/the-menu-bar#Window-menu), these menu items should be provided automatically when creating a Window menu on macOS.

      Steps to reproduce:

      1. Create a minimal PySide6 application on macOS with a Window menu
      2. Run the application
      3. Observe the Window menu contents

      Expected behavior:
      Window menu should automatically include standard macOS items:

      • Minimize (⌘M)
      • Zoom
      • Bring All to Front
      • Enter Full Screen (^⌘F)
      • Window list (when multiple windows are open)

      Actual behavior:

      • Window menu only shows manually added items
      • No native macOS menu items are automatically added
      • Menu disappears completely if no manual items are added

      Environment:

      • PySide6 version: 6.8.0.2
      • Python version: 3.x
      • OS: macOS

      Minimal reproducible example:

      from PySide6.QtGui import QAction
      from PySide6.QtWidgets import QApplication, QMainWindow, QMenu
      import sys
      
      class TestWindow(QMainWindow):
          def __init__(self):
              super().__init__()
              self.setWindowTitle("Test Window Menu")
      
              menubar = self.menuBar()
              menubar.setNativeMenuBar(True)
      
              edit_menu = QMenu("Edit", menubar)
              minimize_action = QAction("Dummy Action", edit_menu)
              edit_menu.addAction(minimize_action)
      
              window_menu = QMenu("Window", menubar)
              minimize_action = QAction("Dummy Action", window_menu)
              window_menu.addAction(minimize_action)
      
              help_menu = QMenu("Help", menubar)
              minimize_action = QAction("Dummy Action", window_menu)
              help_menu.addAction(minimize_action)
      
              menubar.addMenu(edit_menu)
              menubar.addMenu(window_menu)
              menubar.addMenu(help_menu)
      
      app = QApplication(sys.argv)
      window = TestWindow()
      window.show()
      sys.exit(app.exec())
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              lalit Lalit P
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes