PDA

View Full Version : QMenu mac



migel
22nd September 2011, 11:07
Any idea how to add an QAction into mac menubar ? Mac has default first menu named as name of the application, it appears on menubar as first on left. I want to add an action there but the code below seems not working.


QAction *b1 = new QAction(tr("Check for Updates"), this);
_ui->menubar->addAction(b1);
connect(b1, SIGNAL(triggered()), this, SLOT(checkForUpdates()));

I have created default mainwindow.ui form.

Any ideas ?

Thanks for help.

llev
26th September 2011, 19:06
As to action to put under "AppName": try to set action's menu role with QAction::ApplicationSpecificRole value before adding to the bar.
For instance:


b1->setMenuRole( QAction::ApplicationSpecificRole );