The following is an example of how a menu item Aboutworks correctly on a Mac, in C ++. The key to the setMenuRoleright role. There are roles for Quit, About, Preferences, and About Qt. A menu item with the application name in bold is provided by the OS, you do not need to do anything to get this. Qt automatically moves elements with the correct roles where they belong. You do not need to do anything to get the "Exit" menu item; it is automatically added if you have not provided it.
Qt Designer, menuRole QActions. , , . . Windows ( "", "", "" ), .
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationVersion(...);
a.setOrganizationName(...);
a.setOrganizationDomain(...);
a.setApplicationName(...);
MainWidget w;
QMessageBox * aboutBox = new QMessageBox(&w);
QImage img(":/images/youricon.png");
aboutBox->setIconPixmap(QPixmap::fromImage(
img.scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
QString txt;
txt = txt.fromUtf8(
"fooapp %1\nCopyright \xC2\xA9 2012 Ed Hedges\n"
"Licensed under the terms of ....");
txt = txt.arg(a.applicationVersion());
aboutBox->setText(txt);
QMenuBar menu;
QMenu * submenu = menu.addMenu("Help");
QAction * about = submenu->addAction("About", aboutBox, SLOT(exec()));
about->setMenuRole(QAction::AboutRole);
w.show();
return a.exec();
}