Interal QMenuBars on Mac



  • 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


  • Lifetime Qt Champion

    Hi,

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

    Beware of the limitations described in the documentation.

    Hope it helps



  • 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.


  • Lifetime Qt Champion

    Can you show how you setup one of these widgets ?



  • 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);
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.