App's menubar overlaps with Android status bar



  • I have generated a very simple app with qt creator and deployed it on an android tablet. The app runs fine, however its menubar overlaps the device's status bar. How can I position correctly the menubar below the status bar? Also is there a way to hide the device's status bar completely? The QML code is given below. Thanks for your help! Note: I have also asked this question on stackoverflow

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.Dialogs 1.2
    import QtQuick.Layouts 1.0
    
    ApplicationWindow {
        visible: true
        title: qsTr("Hello World")
        width: 640
        height: 480
    
        menuBar: MenuBar {
            Menu {
                title: qsTr("File")
                MenuItem {
                    text: qsTr("&Open")
                    onTriggered: console.log("Open action triggered");
                }
                MenuItem {
                    text: qsTr("Exit")
                    onTriggered: Qt.quit();
                }
            }
        }
    
        MainForm {
            anchors.fill: parent
            button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
            button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
        }
    
        MessageDialog {
            id: messageDialog
            title: qsTr("May I have your attention, please?")
    
            function show(caption) {
                messageDialog.text = caption;
                messageDialog.open();
            }
        }
    }
    


  • <application
    ...
    android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
    ...
    </application>

    this will make your app launch in full screen mode, you have to add it in your manifest file.
    it works with android 4.0 and lower.
    Check this link for further information..
    http://developer.android.com/intl/pt-br/training/system-ui/status.html


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.