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

QMenu::addSection on OS X: OS doesn't support texted separators

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.4.1, 5.5.0 Alpha
    • None
    • Mac OS X
    • macOS

    Description

      Qt5 gained QMenu::addSection() (maybe from KMenu::addTitle()), but this function does not work properly on Mac OS X.
      It tries to make an underlined menu item (OS X jargon for a menu action) by creating a QAction with the specified text (and icon), and then adding a separator to it using `action->setSeparator(true)`.

      On OS X, this turns the action into a separator, which IMHO is worse than creating a visually non-distinct item.

      For the KDE4 equivalent (KMenu::addTitle()), I patched the code so that on OS X it adds both the text item and 1 or 2 separators above and/or below the title text item depending on the location in the menu; I deactivate the title text item to make it visually distinct. Other solutions are of course possible.

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            rjvbertin René Bertin
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes