[Android-development] Forcing native menubar to show

maitai at virtual-winds.org maitai at virtual-winds.org
Mon Oct 6 15:00:24 CEST 2014



>> That should be possible, yes :) But if you don't want the action bar
>>> or react to the physical menu button, then you have to disable the
>>> main window's menu bar and just use your own pop-up instead.
>>> 
>> 
>> Of course I have tried that, the problem is that it doesn't look 
>> native at all, and plain ugly in many cases...
> 
> Hmm, right, sorry, Qt Widgets is not using QPA for pop-up menus, so
> that won't work.
> 
> What you can do then is to use the private API in QPA to create the
> platform menus manually. Take a look at QtGui/qpa/qplatformmenu.h and
> QtGui/qpa/qplatformtheme.h.
> 
> -- Eskil

Ok, but am I supposed to put these defs and all other related defs in my 
own project? There is no such module in <qt> unless you pick them 
directly from qt sources (as you said it's private). I've already done 
that bad thing to build my own QAndroidStyle and the only thing I want 
is to get rid of it in 5.4;).

IMO it would be much simpler to be able to call something similar to:

activity.callMethod<void>("openOptionsMenu","()V");

I will give a try at qpa anyway...

Regards,
Philippe






More information about the Android-development mailing list