I am running osx mountain lion (10.8.3) and when I run the code in the link below, I have a menu with only one action...

https://gist.github.com/Supm4n/8c705154b8586618f4cc

the other strange thing is that when I compile with only one action other than goOnline, I cannot see any menu when I click on the sys tray icon.

My Qt version is 5.0.1

Thanks in advance for your help.

有帮助吗?

解决方案

On MacOS Qt treats some "standard" MacOS menu items in special way. You are using "Quit" and "About", which are determined by Qt as "standard" for MacOS.

Detailed description and customization details are provided in official Qt docs for QMenuBar http://qt-project.org/doc/qt-4.8/qmenubar.html

Checkout section "QMenuBar on Mac OS X" under the link above.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top