I have been having problems adding a menu item to the built in menu bar in a Qt desktop application. I copied the code provided in the QMainWindow class reference documentat
It's pretty old Qt bug on OS X. You can work with QMenu and QMenuBar by calling QMenuBar::addAction, QMenuBar::removeAction and QMenuBar::insertAction. The trick is done by calling of QMenu::menuAction method.
Check the code below:
QMenu *menu = new QMenu("First menu");
menu->addAction("item 1");
menu->addAction("item 2");
m_menuBar->addAction(menu->menuAction());
Also you can check my another answer here with code snippet ready to compile and run.