Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

My file menu is not full of eels

Or, why do my menus behave oddly on macOS when translated?

QMenuBar* mb = new QMenuBar();

QAction* openAction = new QAction(tr("Open saved configuration..."));
openAction->setMenuRole(QAction::NoRole); // change from Qt::TextHeuristicRole

QAction* saveAction = new QAction(tr("Save configuration as..."));
saveAction->setMenuRole(QAction::NoRole); // change from Qt::TextHeuristicRole

QMenu* fileMenu = mb->addMenu(tr("File"));
fileMenu->addAction(openAction);
fileMenu->addAction(saveAction);

About KDAB


JamesTurner

James Turner

Senior Software Engineer & Teamlead