Menu not showing up in menuBar
-
-
Thanks,
I encountered the same problem when I created a new QMainwindow project using the native MenuBar and adding some items to it.
The MenuBar does not appear after running the program, and appears only when double clicking the windoow to make it full screen.
the code line:
@menuBar()->setNativeMenuBar(false);// Trick to see native MenuBar@
You can say it is the trick to see the native MenuBar, but for me it has no sense especially the false thing. The question still remains why it does not appear in-spite automatic generation? -
I had the same issue of the menu bar not showing (config: Qt 5.2 , ubuntu 13.10). This trick solved the issue:
@menuBar()->setNativeMenuBar(false);@ -
which platform you are trying ? If Ubuntu and Mac, platform do some intelligence. Just try to add few more actions like QAction("David") , QAction("Dheeru") like this. It will start showing up. Since you are default "Quit" and "Quit" is by default available. So it may not be showing up.
-
Where would I add this code to get it to work? Not sure which file it has to go in. New to QT and any help would be appreciated :)
@DavidMc Hi, add the following to your main.cpp:
QCoreApplication::​setAttribute(Qt::AA_DontUseNativeMenuBar)
Same effect, just for all your menu bars.
Cheers! -
[quote author="Loulou" date="1387722347"]I had the same issue of the menu bar not showing (config: Qt 5.2 , ubuntu 13.10). This trick solved the issue:
@menuBar()->setNativeMenuBar(false);@[/quote]Thank you, It also worked for me on mac os !
-
[quote author="Loulou" date="1387722347"]I had the same issue of the menu bar not showing (config: Qt 5.2 , ubuntu 13.10). This trick solved the issue:
@menuBar()->setNativeMenuBar(false);@[/quote]Thank you, It also worked for me on mac os !
-
@DavidMc Hi, add the following to your main.cpp:
QCoreApplication::​setAttribute(Qt::AA_DontUseNativeMenuBar)
Same effect, just for all your menu bars.
Cheers!I just ran into the same problem trying to follow the Qt5 tutorial from https://doc.qt.io/qt-5/qtwidgets-tutorials-notepad-example.html on MacOS Catalina (no menu bar mystery after building), which has no warnings about differences between platforms. This saved me some time before I delve into macextras
-
Hi guys, very new into Qt, just got this workin on high sierra/PyCharm/PyQt 5.15.3. My menubar is called "menubar" => self.menubar.setNativeMenuBar(False)
...if you try to solve it from python side. Thanks a bunch! -
Hi guys, very new into Qt, just got this workin on high sierra/PyCharm/PyQt 5.15.3. My menubar is called "menubar" => self.menubar.setNativeMenuBar(False)
...if you try to solve it from python side. Thanks a bunch!@astroonaut Excellent .. works- Thanks
-
Late bump, but one possibility if this is coming from PyQT - if the menu is not attributed to a class, it will be deleted by the garbage collection. changing menu = ... menuBar().addMenu('XX') to self.menu ..... worked for me.
-
Well, there's no more window bar nor app icons on Windows 10