Fix duplicate about entries in mac app menu
Clearing the menu bar does not remove the actions from the app menu, but setting the action role allows Qt to take care of duplicates.
This commit is contained in:
@@ -203,10 +203,14 @@ Action * StdCmdAbout::createAction(void)
|
||||
this->className(), sStatusTip).arg(exe));
|
||||
pcAction->setWhatsThis(QLatin1String(sWhatsThis));
|
||||
pcAction->setIcon(QApplication::windowIcon());
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
//Prevent Qt from using AboutRole -- fixes issue #0001485
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
#if QT_VERSION > 0x050000
|
||||
// Needs to have AboutRole set to avoid duplicates if adding the about action more than once on macOS
|
||||
pcAction->setMenuRole(QAction::AboutRole);
|
||||
#else
|
||||
// With Qt 4.8, having AboutRole set causes it to disappear when readding it: issue #0001485
|
||||
pcAction->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
|
||||
#endif
|
||||
return pcAction;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user