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. QT Android Gboard overlaps input fields
Forum Updated to NodeBB v4.3 + New Features

QT Android Gboard overlaps input fields

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 570 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.
  • W Offline
    W Offline
    Wiru
    wrote on last edited by
    #1

    Since the last update of the Gboard Qt seems to have issues with detecting it and push input fields above it accordingly.
    Gboard version: 9.7.09.323382208-tv_release-armeabi-v7a

    enter image description here

    I have a minimal code example in which it can be easily reproduced:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.12
    
    ApplicationWindow {
        width: 1920
        height: 1080
        visibility: Window.Maximized
        color: "#C0C0C0"
    
        Item
        {
            width: 1920 * 0.7
            height: 1080 * 0.8
            Item {
                width: parent.width
                height: parent.height * 0.4
                id: we
            }
            TextField
            {
                id: input1
                width: parent.width
                focus: true
                anchors.top: we.bottom
                onAccepted: input2.focus = true
    
                Keys.onPressed:
                {
                    switch (event.key) {
                    case Qt.Key_Tab:
                    case Qt.Key_Down:
                        event.accepted = true
                        input2.forceActiveFocus()
                        break
                    }
                }
            }
    
            TextInput
            {
                id: input2
                width: parent.width
                anchors.top: input1.bottom
                maximumLength: 40
    
                Keys.onPressed:
                {
                    switch (event.key) {
                    case Qt.Key_Tab:
                    case Qt.Key_Down:
                        event.accepted = true
                        break
    
                    case Qt.Key_Up:
                        event.accepted = true
                        input1.forceActiveFocus()
                        break
                    }
                }
            }
        }
    }
    
    

    I tried to build with Qt versions: 5.12.9, 5.13.2, 5.14.2, 5.15.1 and all have the same issue. However an empty project from Android studio will push the input fields correctly, so the issue must be Qt related.

    I also tried to set android:windowSoftInputMode="adjustPan" but it had no effect at all.

    What I found is the Qt showSoftwareKeyboard method in QtActivityDelegate.java, I assume it's responsible for displaying the keyboard and adjusting the layouts, so I tried to play around with it a bit (setting some hard-coded values e.g. m_layout.setLayoutParams(m_editText, new QtLayout.LayoutParams(width, 680, 30, 500), false)), rebuild Qt with the changes, but with no success or visible changes, it does print out my custom logs so the changes did apply correctly.

    Any ideas how to make it push the input fields?

    K 1 Reply Last reply
    0
    • W Wiru

      Since the last update of the Gboard Qt seems to have issues with detecting it and push input fields above it accordingly.
      Gboard version: 9.7.09.323382208-tv_release-armeabi-v7a

      enter image description here

      I have a minimal code example in which it can be easily reproduced:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      
      ApplicationWindow {
          width: 1920
          height: 1080
          visibility: Window.Maximized
          color: "#C0C0C0"
      
          Item
          {
              width: 1920 * 0.7
              height: 1080 * 0.8
              Item {
                  width: parent.width
                  height: parent.height * 0.4
                  id: we
              }
              TextField
              {
                  id: input1
                  width: parent.width
                  focus: true
                  anchors.top: we.bottom
                  onAccepted: input2.focus = true
      
                  Keys.onPressed:
                  {
                      switch (event.key) {
                      case Qt.Key_Tab:
                      case Qt.Key_Down:
                          event.accepted = true
                          input2.forceActiveFocus()
                          break
                      }
                  }
              }
      
              TextInput
              {
                  id: input2
                  width: parent.width
                  anchors.top: input1.bottom
                  maximumLength: 40
      
                  Keys.onPressed:
                  {
                      switch (event.key) {
                      case Qt.Key_Tab:
                      case Qt.Key_Down:
                          event.accepted = true
                          break
      
                      case Qt.Key_Up:
                          event.accepted = true
                          input1.forceActiveFocus()
                          break
                      }
                  }
              }
          }
      }
      
      

      I tried to build with Qt versions: 5.12.9, 5.13.2, 5.14.2, 5.15.1 and all have the same issue. However an empty project from Android studio will push the input fields correctly, so the issue must be Qt related.

      I also tried to set android:windowSoftInputMode="adjustPan" but it had no effect at all.

      What I found is the Qt showSoftwareKeyboard method in QtActivityDelegate.java, I assume it's responsible for displaying the keyboard and adjusting the layouts, so I tried to play around with it a bit (setting some hard-coded values e.g. m_layout.setLayoutParams(m_editText, new QtLayout.LayoutParams(width, 680, 30, 500), false)), rebuild Qt with the changes, but with no success or visible changes, it does print out my custom logs so the changes did apply correctly.

      Any ideas how to make it push the input fields?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Wiru

      You should check on JIRA for a report on this. If there is none, you may file a bug report. This forum is not monitored for potential bug reports. Therefore, it might get lost and nobody takes care.

      Anyway if there is a bug report, please post a link here for others to be able to vote for it.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wiru
        wrote on last edited by
        #3

        Well I guess there is no other option, I opened the ticket, can only hope it gets actually fixed or for a workaround.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          floraoliviaa
          Banned
          wrote on last edited by
          #4
          This post is deleted!
          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