[Android-development] Questions related to QMenuBar and Android native menu

maitai at virtual-winds.org maitai at virtual-winds.org
Wed Mar 12 10:15:19 CET 2014


Hello,

I need some explanations and hints on the way QMenuBar is seen as the 
Android native menu on Android (i.e. accessible through the menu key on 
the device).

I have created a QMenuBar *, which when running on Android I do not set 
as the QMainWindow's menubar. Magically, it becomes the native menu on 
Android, although I didn't ask anything like qApp::setMenubar() or 
something similar. It works perfectly, but I would like to ask the 
following questions:

- my QMenuBar becomes the Android's native menubar just because it's the 
first one created in the application?
- What if I create a second menuBar and want to switch from one to 
another depending on context? Is there a way to specify which menubar is 
the active one?
- I would like to have some QAction at the first level of the android 
menu (i.e. some subMenus plus some QActions at the same first level). 
AddAction() is not supported in a menuBar, so I tried to insert an empty 
QMenu and play with its menuAction but didn't achieve anything good. Is 
there a way to do this?

Any help or comment would be greatly appreciated

Thanks
Philippe Lelong.



More information about the Android-development mailing list