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
The answer that has the most upvote works for Python, but question is for C++. However, the method is the same.
You can add this line on top of your constructor in mainwindow.cpp:
menuBar()->setNativeMenuBar(false);