Android virtual keyboard input trouble

  • Hello everybody

    I'm having some issues with the virtual keyboard input in an android app.

    The first issue is:
    When the keyboard pops up it overlap with the lower part of the app.
    If editing some text input in the occluded part of the app, the entire app moves up hiding the upper elements.

    The second issue is:
    adding android:windowSoftInputMode="adjustResize" in the manifest xml didn't solve the problem.

    The third issue:
    The property Qt.inputMethod.visible returns the visibility of the soft keyboard correctly.
    but Qt.inputMethod.keyboardRectangle.height always return 0

    example code:

    import QtQuick 2.2
    import QtQuick.Controls 1.2
    import QtQuick.Layouts 1.1

    ApplicationWindow {
    id: applicationWindowMain
    visible: true
    width: 300
    height: 500
    title: qsTr("keyboard test")
    Rectangle {
    id: rectangleMain
    width: 200
    height: 50
    color: "#ffffff"

        Label {
            id: labelOut
            y: 18
            text: "Virtual Keyboard Visible: " + Qt.inputMethod.visible + " height: " + Qt.inputMethod.keyboardRectangle.height
            anchors.leftMargin: 4
            anchors.left: parent.left
            anchors.verticalCenter: parent.verticalCenter
    TextField {
        id: textField1 rectangleMain.bottom
        anchors.topMargin: 28
        anchors.left: parent.left
        anchors.leftMargin: 28
        placeholderText: qsTr("tap here")


    Am I making something wrong?
    Please help.

    Thanks in advance.

  • Qt Champions 2016

    It is known bug. Should be fixed but not available in Qt 5.3.2 yet. It will be bundled with Qt 5.4.

  • Ok, Thanks for the fast reply.

    Qt 5.3.2 is what I'm using right now.

    My new question:
    Is there a workaround for this?

    or some other way to accomplish the wanted behavior?

    Thanks in advance.

  • Qt Champions 2016

    I just design my application to have text input area in the upper region to avoid this problem. I didn't found another solution yet.

    However, I just checked the patch for this problem. Seem that it will only modify few lines of a Java source file. I wonder it may just replace the QtAndroid-bundled.jar will fix the problem.

    Qt 5.4 is still alpha without pre-built binary yet. The beta release with pre-built binary should be coming soon. You may try to replace the .jar file from the release or compile by yourself.

  • Ok, nice to see maybe there is a solution.
    Where can I find some info about this java modification?
    Is it on the Qt git repository?


  • Qt Champions 2016

  • Qt Champions 2016

  • Thank you for the info benlau,

    I just downloaded this beta snapshot but problem persist.

    Qt.inputMethod.keyboardRectangle.height always equal 0

    is it expected to be solve in the 5.4 release?

  • Qt Champions 2016

    The patch should just enabled the support to android:windowSoftInputMode=“adjustResize” . I think they didn't fixed the keyboard rectangle yet. It is better to submit a ticket in the issue tracker.

  • Thank you benlau.
    with this workaround I'm able to continue with my project.
    Best Regards

  • I have such problem in windows phone 8.1.
    Qt 5.5.
    How to fix it?

Log in to reply

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