[Android-development] Forcing native menubar to show

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


On 10/06/2014 10:10 AM, maitai at virtual-winds.org wrote:
> Hi Eskil, thanks for your reply
>
> A summary of what happened:
>
> With target=api level 15 (the default)
>
> On a device with a physical menu button running android 4.4.2, no problem
> On a device without any physical button running android 4.0.4, the 
> menu icon (the 3 vertical dots) does not show in android statusbar.

On the second device, is there an action bar with an overflow button 
which gives you the menu? Because that's the intended way it should work 
in Android 3.0 and up. The overflow button with the vertical dots in the 
system navigation bar is a compatibility feature and will look ugly on 
some devices (we had reports of this for the tech preview in Qt 5.1 
days, where we always targeted android 10 by default).

>
> I have yet another issue: One of my user has a Samsung Galaxy 
> S5/Android 4.4.2. On this device, the menu button is physical, but the 
> user has to press long on it, otherwise he gets the tasks window. This 
> is not convenient at all for him, as you can understand. Maybe his 
> device is replying "true" when asked if it has a physical button, and 
> therefore qt decides not to show the menu button (and even the 
> statusbar)? I have tried to target level 10, 15 and 19 for this 
> device... no way to get a better menu button.

If there is a physical menu button, then Qt should use this. Do other 
applications on his device show software buttons for the menus in 
addition to the physical button?

>
> Ideally I would like to target level 15, and to be able to call the 
> native menu myself from inside the application. That way I could have 
> a menu button somewhere in my app, plus I could launch the native menu 
> on some user action (for instance a long-press on a QGraphicsItem).

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.

-- Eskil




More information about the Android-development mailing list