Hi there,
I have an app for symbian s60 that is running great. I am trying to finish off the last few bugs and am having trouble removing an action whose text is "Action" from my QMenuBar. It seams there is a default action inserted at the beginning of the new QMenuBar.
I followed the tutorials (both regular and dynamic menu creation) from nokia forums, and my current code looks like:
mainwindow.h
public slots:
void aboutAction();
void helpAction();
private:
public slots:
void aboutAction();
void helpAction();
private:
QAction* menuAboutAction;
QAction* menuHelpAction;
To copy to clipboard, switch view to plain text mode
mainwindow.cpp (createMenu() is called in constructor)
void MainWindow::createMenu()
{
menuAboutAction
= new QAction("About",
this);
menubar()->addAction(menuAboutAction);
connect(menuAboutAction,SIGNAL(triggered()), this, SLOT(aboutAction()));
menuHelpAction
= new QAction(tr
("Help"),
this);
menubar()->addAction(menuHelpAction);
connect(menuHelpAction,SIGNAL(triggered()), this, SLOT(helpAction()));
}
void MainWindow::createMenu()
{
menuAboutAction = new QAction("About", this);
menubar()->addAction(menuAboutAction);
connect(menuAboutAction,SIGNAL(triggered()), this, SLOT(aboutAction()));
menuHelpAction = new QAction(tr("Help"),this);
menubar()->addAction(menuHelpAction);
connect(menuHelpAction,SIGNAL(triggered()), this, SLOT(helpAction()));
}
To copy to clipboard, switch view to plain text mode
when menu is opened options available are : "show open apps"; "About"; "Help"; "Actions";. I would like to remove "Actions".
I am testing this on a nokia 6970 (surge) running symbian s60 v3.2. same issue occurs in s60 v5 emulator. I have tried calling optionsMenu->clear(); before adding actions, and calling optionsMenu->removeAction(action) (tried a few guesses to remove default with no luck). menuBar in mainwindow.ui has been created (tried with and without with same results).
The demo app from nokia (optionsmenu) runs great on my device, and it looks to me like they are created the same.
Thanks for any help.
Bookmarks