The QMainWindow you create does not look like a native Cocoa window. The status bar is there, no matter what you request, the menu doesn't port and the icon is yucky.
Here's what you can do:
Remove status bar/resize grip:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setupWindowWithoutStatusBar(QWidget* w){ | |
NSView* view = (NSView*) w->winId(); | |
NSWindow* win = [view window ]; | |
[win setShowsResizeIndicator:FALSE]; | |
NSUInteger mask = [win styleMask]; | |
[win setStyleMask:mask | ~NSResizableWindowMask]; | |
} |
Don't show unneeded icon in the title bar and move a QAction to Mac's main menu:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef Q_OS_MAC | |
setWindowIcon( QIcon(":/windowIcon") ); | |
#else | |
myAction->setMenuRole(QAction::ApplicationSpecificRole); | |
#endif |