MenuBar Not Showing for Simple QMainWindow Code, Qt Creator Mac OS

前端 未结 6 1469
时光取名叫无心
时光取名叫无心 2020-12-10 15:29

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

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 15:47

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

提交回复
热议问题