Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Interal QMenuBars on Mac

    General and Desktop
    2
    5
    785
    Loading More Posts
    • 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
      Andaharoo last edited by Andaharoo

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • A
          Andaharoo last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • A
              Andaharoo last edited by

              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 Reply Quote 0
              • First post
                Last post