Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android virtual keyboard input trouble
Forum Updated to NodeBB v4.3 + New Features

Android virtual keyboard input trouble

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 3 Posters 5.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    freddy311082
    wrote on 22 Sept 2014, 18:36 last edited by
    #1

    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
        anchors.top: 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.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      benlau
      Qt Champions 2016
      wrote on 22 Sept 2014, 19:25 last edited by
      #2

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

      https://bugreports.qt-project.org/browse/QTBUG-34401

      1 Reply Last reply
      0
      • F Offline
        F Offline
        freddy311082
        wrote on 22 Sept 2014, 19:32 last edited by
        #3

        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.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          benlau
          Qt Champions 2016
          wrote on 22 Sept 2014, 19:49 last edited by
          #4

          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.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            freddy311082
            wrote on 22 Sept 2014, 20:04 last edited by
            #5

            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?

            Regards.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              benlau
              Qt Champions 2016
              wrote on 22 Sept 2014, 20:09 last edited by
              #6

              https://codereview.qt-project.org/#/c/93881/

              1 Reply Last reply
              0
              • B Offline
                B Offline
                benlau
                Qt Champions 2016
                wrote on 24 Sept 2014, 13:28 last edited by
                #7

                Qt 5.4 beta binary has been released!

                http://download.qt-project.org/snapshots/qt/5.4/5.4.0-beta/2014-09-24_24/

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  freddy311082
                  wrote on 25 Sept 2014, 13:58 last edited by
                  #8

                  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?

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    benlau
                    Qt Champions 2016
                    wrote on 25 Sept 2014, 14:12 last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      freddy311082
                      wrote on 26 Sept 2014, 21:11 last edited by
                      #10

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

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        padicao
                        wrote on 22 Aug 2015, 07:02 last edited by
                        #11

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

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved