开发者

Windows-like Qt4 Menubar in Mac Os X

I would like my application to look similar to that of the Windows version: instead of the menu be开发者_JAVA技巧ing displaced to the top menu in Os X, I'd like my program to have the file menu right on top of the application itself.

I've looked at the Qt documentation regarding this, but I can't seem to create an empty QMenuBar as the top level QMenuBar. (I'm using a subclass of QMainWindow...)


This is a bad idea and will not win your application fans in the Mac community. Here are the Apple Human Interface Guidelines.


Why would he want to do this? Multiple Monitors, that's why. Complete pain in the keester to have to move your mouse from the monitor you are working in back to the main monitor to access the menu bar and then all the way back over to the monitor you were in. I think it would be FANTASTIC if more mac apps at least had the option to place their menu directly in the application window.


The first menubar you create becomes the main mac menubar. You could try creating a dummy one immediately after you create the QApplication. You might want to put at least a quit command in there.

Alternatively, you can call QApplication::setAttribute with Qt::AA_DontUseNativeMenuBar. I don't know what will fill the mac menubar in that case, however.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜