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

macOS Application menu can still lose About, Preferences, and Quit menu items

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.6
    • None
    • macOS

    Description

      In applications with multiple main Windows on macOS, you can still lose Quit, About, and Preferences menus in the QMenuBar Application menu under Qt 5.12.6

      This happens because if a user closes the first QMainWindow that lies behind a current QMainWindow by just clicking on the red close button without making that window active, the qtbase/src/plugins/platforms/cocoa/qcocoamenubar.mm in the destructor will not end up calling updateMenuBarImmediately() due to the condition tests in the following "if" (due to recent reparenting?).

      I can easily recreate this issue in my app Sigil. And I can enable the built in debug in that file and create traces showing the problem if that would help.

      The attached patch fixes this for Qt 5.12.6 for me by moving the call to updateMenuBarImmediately() to be outside the "if" so that the copied main App menu is always properly updated.

      Please see the attached patch and let me know if you want me to enable the QDebug statements in qtbase/src/plugins/platforms/cocoa/qcocoamenubar.mm and generate traces that illustrate what is going on.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              kevinhendricks Kevin B. Hendricks
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes