[Qt-interest] How to hide softkey menu on Symbian?
alessandro.portale at nokia.com
alessandro.portale at nokia.com
Fri Dec 3 11:15:58 CET 2010
Hi,
as a workaround, I believe you can set the action as a context action of your main widget/dialog/window . The action should appear as softkey and not open any submenu
http://doc.qt.nokia.com/4.7/qwidget.html#softkeys
Hope that helps,
Alessandro
________________________________________
From: qt-interest-bounces at trolltech.com [qt-interest-bounces at trolltech.com] On Behalf Of ext Tomasz Baniak [thomas.baniak at gmail.com]
Sent: Friday, December 03, 2010 11:06
To: qt-interest at trolltech.com
Subject: [Qt-interest] How to hide softkey menu on Symbian?
Hi!
I would like to hide a softkey menu (NOT a softkey, but a menu that is possibly shown) on Symbian (to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-14589).
I did not succeed to do it in my app. I checked it on simple app with left softkey menu constructed as this:
QMenu* m_menu;
...
m_menu = new QMenu(this);
m_menu->addAction("Option 1", this, SLOT(menuItemTriggered()));
m_menu->addAction("Option 2", this, SLOT(menuItemTriggered()));
m_menu->addAction("Option 3", this, SLOT(menuItemTriggered()));
QAction *myMenuKey = new QAction("MyMenu", this);
myMenuKey->setSoftKeyRole(QAction::PositiveSoftKey);
myMenuKey->setMenu(m_menu);
menuBar()->addAction(myMenuKey);
and could not hide it in any way.
I have tried:
m_menu->close();
m_menu->hide();
m_menu->setVisible(false);
without any success
It seems that Symbian uses it's native menu and it has not much to do with QMenu i used in a code above as it is possible to open MyMenu by clicking action key and display it and in the same moment display second 'instance'(?!) of the same menu by calling popup() (2 menus with the same options visible).
On Windows the above situation works as expected (only 1 menu visible at time).
Also calling (on Windows) hide/close does the trick to actually hide it.
I will fill the bug later for 'double menu issue' later. But back to my question:
How could i hide this left softkey menu on Symbian?
Tomek
More information about the Qt-interest-old
mailing list