Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108797

Tasks related to providing native menus (popup/context/menubar) for Widgets and Quick

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P2: Important
    • None
    • Some future release
    • GUI: Menus
    • None
    • Native menus
    • All

    Description

      While we have QtGui platform abstractions for native menus, menu items, and menu bars, they are only used in a few places:

      • QMenuBar
        • Shows a native menu as a popup iff
          • QMenuBar::isNativeMenuBar() is false
            • Which is not normally the case on macOS
            • But is the case on Window
          • qt_set_sequence_auto_mnemonic() is true
            • Which it is not on macOS unless called explicitly
            • But is the case on Windows
          • A menu item is triggered via its corresponding mnemonic, and that item is/has a menu that should open
          • That menu has a platform menu
            • Which it normally does not have, unless
              • Someone has called toNSMenu() earlier
              • Or the internal QMenu::setPlatformMenu()
                • Used by QSystemTrayIconPrivate::addPlatformMenu()
                  • (Plumbed to QPlatformTheme::createPlatformMenu() via QPlatformSystemTrayIcon::createMenu())
                  • But the system tray icon's menu is not tied to QMenuBar in any way, so this is not relevant
        • In summary
          • The logic is only triggered on Windows (unless the user jumps through many hoops that's not really supported)
          • But requires a platform menu, which is only likely to be the case on macOS via toNSMenu
          • Ie, the QMenuBar QPlatformMenu::showPopup() logic can likely be removed
            • Everything else works on a QPlatformMenuBar level already, so native menus still work
      • QComboBox::showPopup()
        • Iff
          • On an Apple OS
          • If the style reports true for SH_ComboBox_UseNativePopup, which only the iOS plugin does

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            vestbo Tor Arne Vestbø
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes