Creating a Symbian's like Application Menu
Hello, I wanted to make an app which is when started it shows a menu. It is just like when you open a Messaging app in S60. Here is a screenshot http://bit.ly/jVDiXo.
How do I make it? I have tried to make the centralWidget of the QMainWindow as QMenu, and adding QAction to the QMenu. But when I'm running it, the app don't show anything. And I have tried to make the QMenu using QMenuBar. And it is show okay. But I can't use the up/down key to select menu in the device. And when I press the options key (Qt::PositiveSoftKey), the menubar shows up too. And I didn't even add that to menuBar() which is owned by QMainWindow.
Here is my first code:
Code:
QObject::connect(tes,
SIGNAL(triggered
()),
this,
SLOT(close
()));
QObject::connect(tes,
SIGNAL(triggered
()),
this,
SLOT(close
()));
menu->addAction(act1);
menu->addAction(act2);
setCentralWidget(menu);
It shows nothing at the apps.
And here is my second try:
Code:
QObject::connect(tes,
SIGNAL(triggered
()),
this,
SLOT(close
()));
QObject::connect(tes,
SIGNAL(triggered
()),
this,
SLOT(close
()));
QMenu* menu
= menubar
->addMenu
(tr
("menu"));
menu->addAction(act1);
menu->addAction(act2);
setCentralWidget(menu);
It shows the menu. But when I deploy to the device, I can't use the keypad to select the menu. And at the simulator, if I click other place than the QAction item, the menu lost.
What is the correct way to do this? Or is my way correct? What should I do next then?
Re: Creating a Symbian's like Application Menu