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. Interal QMenuBars on Mac
Qt 6.11 is out! See what's new in the release blog

Interal QMenuBars on Mac

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.9k 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.
  • A Offline
    A Offline
    Andaharoo
    wrote on last edited by Andaharoo
    #1

    I have a windows application that I'd like to build for Mac. Everything goes fine except the menubars. I have 4 views in my application (like Maya or other 3d software) and above each window is a menubar. Unfortunately those disappear on Mac when that is not the intention. Is there any way to get them back without manually programming my own qmenubar?

    0_1513198171050_Screenshot (1).jpg

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

      Hi,

      You might want to try with the QMainWindow:: unifiedTitleAndToolBarOnMac property.

      Beware of the limitations described in the documentation.

      Hope it helps

      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
      • A Offline
        A Offline
        Andaharoo
        wrote on last edited by
        #3

        This didn't seem to do anything? I added an image to better show what I was describing. I have multiple widgets each with a menubar above them but they dissapear on Mac.

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

          Can you show how you setup one of these widgets ?

          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
          • A Offline
            A Offline
            Andaharoo
            wrote on last edited by
            #5

            They're initially in my UI file. A QWidget morphed into my own class ViewWidget. My ViewWidget contains a QVTKWidget and a QMenuBar in a box layout (top to bottom). The QMenuBar is created an added. Then the QVTKWidget is created and added.

            QVBoxLayout* qbv = new QVBoxLayout();
            qbv->setDirection(QBoxLayout::TopToBottom);
            qbv->setContentsMargins(1, 1, 1, 1);
            setLayout(qbv);
            menuBar = new QMenuBar();
            menuBar->setPalette(QPalette(QPalette::Background, Qt::white));
            qbv->addWidget(menuBar);
            qvtk = new QVTKWidget();
            qbv->addWidget(qvtk);
            
            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