Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Help menu item not showing
Forum Updated to NodeBB v4.3 + New Features

Help menu item not showing

Scheduled Pinned Locked Moved Solved Qt for Python
7 Posts 3 Posters 582 Views
  • 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.
  • nicholas_yueN Offline
    nicholas_yueN Offline
    nicholas_yue
    wrote on last edited by
    #1

    Using Designer, I created a main window with a Help menu item.

    When I ran it on Linux, I can see the Help menu but when I ran the same code on MacOS, I don't see the Help menu.

    I tried reading the following to understand about global menu but am unable to follow what needs to be done

    https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QMenuBar.html#qmenubar-as-a-global-menu-bar

    It says I need to name my widget with "about.*" but that will make my help button read funny to the user.

    My code is here

    https://github.com/nyue/QtQuestions/tree/main/PySide2/macos_menu_about

    jsulmJ 1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #6

      See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum

      nicholas_yueN 1 Reply Last reply
      1
      • nicholas_yueN nicholas_yue

        Using Designer, I created a main window with a Help menu item.

        When I ran it on Linux, I can see the Help menu but when I ran the same code on MacOS, I don't see the Help menu.

        I tried reading the following to understand about global menu but am unable to follow what needs to be done

        https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QMenuBar.html#qmenubar-as-a-global-menu-bar

        It says I need to name my widget with "about.*" but that will make my help button read funny to the user.

        My code is here

        https://github.com/nyue/QtQuestions/tree/main/PySide2/macos_menu_about

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @nicholas_yue Why do you set the geometry of the menu bar? That should be up to the OS:

        self.menubar.setGeometry(QRect(0, 0, 800, 22))
        

        On MacOS the menu bar is not in the application window but in the top bar of the screen. It is not there for your application?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        nicholas_yueN 1 Reply Last reply
        0
        • jsulmJ jsulm

          @nicholas_yue Why do you set the geometry of the menu bar? That should be up to the OS:

          self.menubar.setGeometry(QRect(0, 0, 800, 22))
          

          On MacOS the menu bar is not in the application window but in the top bar of the screen. It is not there for your application?

          nicholas_yueN Offline
          nicholas_yueN Offline
          nicholas_yue
          wrote on last edited by
          #3

          @jsulm Great question. The code is generated by UIC so the folks at Qt might be in a better knowledge position to answer that.

          jsulmJ 1 Reply Last reply
          0
          • nicholas_yueN nicholas_yue

            @jsulm Great question. The code is generated by UIC so the folks at Qt might be in a better knowledge position to answer that.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @nicholas_yue What about my second question?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            nicholas_yueN 1 Reply Last reply
            0
            • jsulmJ jsulm

              @nicholas_yue What about my second question?

              nicholas_yueN Offline
              nicholas_yueN Offline
              nicholas_yue
              wrote on last edited by
              #5

              @jsulm Just launched and checked again. No, it is not there in the top. Only the "File" menu is there.

              As expected, the Quit item has been moved from File as per the documentation for Global Menu Bar but no Help menu.

              I believe there is a way to hint Qt to pass the menu item in Help for MacOS to do the right thing and place it at a place that adhere to MacOS UI convention. I am just having difficult understanding and digesting the information in the documentation to get it right.

              I am pretty sure I need to do some additional steps but just not sure what is required even after reading the documentation.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                friedemannkleint
                wrote on last edited by
                #6

                See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum

                nicholas_yueN 1 Reply Last reply
                1
                • F friedemannkleint

                  See menu roles of QAction: https://doc.qt.io/qt-6/qaction.html#MenuRole-enum

                  nicholas_yueN Offline
                  nicholas_yueN Offline
                  nicholas_yue
                  wrote on last edited by
                  #7

                  @friedemannkleint Thank you. It works.

                  https://github.com/nyue/QtQuestions/blob/main/PySide2/macos_menu_about/main.py#L12

                  1 Reply Last reply
                  0
                  • nicholas_yueN nicholas_yue has marked this topic as solved on

                  • Login

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