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. MainToolBar doesn't show all the options QtWidgets

MainToolBar doesn't show all the options QtWidgets

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.3k Views 2 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.
  • C Offline
    C Offline
    Carolinabustillo
    wrote on last edited by
    #1

    0_1514999474322_Captura de pantalla 2018-01-03 a las 18.10.00.png
    As you can see in the image above, I have a menuBar with three different menus. The first two is to open other windows and the last one is to exit the app.
    When I visualize de ui file in the Design mode I can see the three menus but when build the app... it only shows the first two and I don't know why.
    I have tried changing the position but nothing happens. It isn't a problem of upgrading the ui file because any other change in the Window is shown.
    Can someone help me?

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

      Hi,

      Are you developing on macOS ?

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Carolinabustillo
        wrote on last edited by
        #3

        @SGaist Yes I am! Is it because of that?

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

          The exit action is automagically moved to the menu which has the name your application to match macOS design.

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

          1 Reply Last reply
          1
          • M Offline
            M Offline
            mpergand
            wrote on last edited by mpergand
            #5

            You need to specify the menu role for a correct behavior on all platforms.

            ex:

            action=menu->addAction(tr("Exit"));
            action->setMenuRole(QAction::QuitRole);
            action->setShortcut(QKeySequence::Quit);
            

            On OSX, the exit menu will move to the App Menu with the name Quit MyApp.
            On Ubuntu usely it's placed at the end of the File menu.

            Same thing is required with Preferences, About and About Qt .

            You can specify the role in the Designer too.

            1 Reply Last reply
            2
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by SGaist
              #6

              More details on the QMenuBar documentation.

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

              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