[Android-development] Forcing native menubar to show

Eskil Abrahamsen Blomfeldt eskil.abrahamsen-blomfeldt at theqtcompany.com
Mon Oct 6 15:00:13 CEST 2014


On 10/06/2014 03:00 PM, maitai at virtual-winds.org wrote:
>
>
>>> 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;).

QT += gui-private core-private

But if you're using Ministro it's a bit risky, since there's no binary 
compatibility guarantee for the private APIs.

-- Eskil



More information about the Android-development mailing list