Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Menu bar does not show up in Mac Qml application after upgrading from Qt6.7.0 to 6.8.0
Forum Updated to NodeBB v4.3 + New Features

Menu bar does not show up in Mac Qml application after upgrading from Qt6.7.0 to 6.8.0

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 946 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mogens Hansen
    wrote on last edited by
    #1

    I have a fairly simple Qt/Qml C++ application.
    After upgrading to from Qt6.7.0 to Qt6.8.0 the menubar does not show up on Mac
    When building the same application for Windows and Linux, using Qt6.8.0 the menubar shows up, like it did with Qt6.7.0

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mogens Hansen
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • I Offline
        I Offline
        IgKh
        wrote on last edited by
        #3

        Hi, can you provide a screenshot of the before / after? Do you mean that the global menu bar is empty, or did you have a menu bar in one of your windows itself which is now moved to the global menu bar (or not shown at all)?

        M 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Which version of macOS is it ?
          Please provide a minimal compilable example that shows this behaviour.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Which version of macOS is it ?
            Please provide a minimal compilable example that shows this behaviour.

            M Offline
            M Offline
            Mogens Hansen
            wrote on last edited by
            #5

            @SGaist than you for the reply

            It is macOS Sonoma 14.6.1 on a M2 Pro, compiled with Clang 15.0.0 arm64-apple-darwin23.6.0

            I have not created a minimal example yet, but wanted to know it if was a known issue

            1 Reply Last reply
            0
            • I IgKh

              Hi, can you provide a screenshot of the before / after? Do you mean that the global menu bar is empty, or did you have a menu bar in one of your windows itself which is now moved to the global menu bar (or not shown at all)?

              M Offline
              M Offline
              Mogens Hansen
              wrote on last edited by
              #6

              @IgKh Thank you for the reply

              The global menu is no longer present.
              It is a fairly small mastermind game application, that I have written to get to learn Qt.
              it is the same Qml and C++ source code for all platforms (which is one of the reasons for testing Qt)

              Qt version comparison.png

              The menubar in qml is

              ApplicationWindow {
                 menuBar: MenuBar {
                    Menu {
                       title: "&Mode"
                       Action {
                          text: "&Demo"
                          onTriggered: boardWindow.model.onSetAutomaticMode()
                       }
                       Action {
                          text: "&Computer Knows Secret"
                          onTriggered: boardWindow.model.onSetEvaluateMode()
                       }
                       Action {
                         text: "&User Knows Secret"
                         onTriggered: boardWindow.model.onSetGuessMode()
                       }
                    }
                    Menu {
                       title: "&Hint"
                       enabled: model.codePegHintEnabled
                       Repeater {
                          model: 4
                          MenuItem {
                             text: (index + 1) + " Color " + (index == 0 ? "Peg" : "Pegs")
                             onTriggered: boardWindow.model.onHint(index+1);
                          }
                       }
                    }
                 }
              
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Might sound silly but are you explicitly setting it to non default on macOS ?
                On this platform the menu bar is at the top of the screen and not the application window.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply
                1
                • SGaistS SGaist

                  Might sound silly but are you explicitly setting it to non default on macOS ?
                  On this platform the menu bar is at the top of the screen and not the application window.

                  M Offline
                  M Offline
                  Mogens Hansen
                  wrote on last edited by
                  #8

                  @SGaist thank you so much
                  That is not silly at all. That is the explanation.
                  The menu is on the top of the screen with Qt 6.8.0
                  I don't know why I didn't look there. It was just used to the menu being shown in the application window on all 3 platforms.

                  I have not explicit set it to non default behavior.
                  As shown in the code, the menu is defined as a child of the ApplicationWindow in Qml. Isn't that the normal way of doing it ?
                  I wonder why the behavior has changed from Qt 6.7.1 to Qt 6.8.0

                  I 1 Reply Last reply
                  0
                  • M Mogens Hansen

                    @SGaist thank you so much
                    That is not silly at all. That is the explanation.
                    The menu is on the top of the screen with Qt 6.8.0
                    I don't know why I didn't look there. It was just used to the menu being shown in the application window on all 3 platforms.

                    I have not explicit set it to non default behavior.
                    As shown in the code, the menu is defined as a child of the ApplicationWindow in Qml. Isn't that the normal way of doing it ?
                    I wonder why the behavior has changed from Qt 6.7.1 to Qt 6.8.0

                    I Offline
                    I Offline
                    IgKh
                    wrote on last edited by
                    #9

                    @Mogens-Hansen That's where macOS users expect application menus to be; that it wasn't this way earlier could be considered a defect in Qt Quick (I searched around and found several forum topics ans stack overflow questions complaining about QML application menus not moving to the global menu bar).

                    The project ticket for the change in Qt 6.8 seems to be https://bugreports.qt.io/browse/QTBUG-69558; though it is not clear to me why this change isn't in the release notes.

                    If you want it to be keep being like it was before, you can set the Qt::AA_DontUseNativeMenuBar attribute on your QGuiApplication.

                    M 1 Reply Last reply
                    1
                    • I IgKh

                      @Mogens-Hansen That's where macOS users expect application menus to be; that it wasn't this way earlier could be considered a defect in Qt Quick (I searched around and found several forum topics ans stack overflow questions complaining about QML application menus not moving to the global menu bar).

                      The project ticket for the change in Qt 6.8 seems to be https://bugreports.qt.io/browse/QTBUG-69558; though it is not clear to me why this change isn't in the release notes.

                      If you want it to be keep being like it was before, you can set the Qt::AA_DontUseNativeMenuBar attribute on your QGuiApplication.

                      M Offline
                      M Offline
                      Mogens Hansen
                      wrote on last edited by
                      #10

                      @IgKh Thank you very much. That makes a lot of sence.
                      I agree that the previous behavior can be considered a defect.
                      I wonder why I didn't notice that before, but I think I was happy that it looked the same on all 3 platforms

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved