Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6, TextField not work in Android
Forum Updated to NodeBB v4.3 + New Features

Qt6, TextField not work in Android

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 3 Posters 797 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.
  • O Offline
    O Offline
    omerfurkan
    wrote on last edited by omerfurkan
    #1

    Hello, I’m developing an application for Android with Qt6, but I’ve encountered a few strange issues while using TextField. The TextField doesn’t seem to read any input method hints flags at all.

    Code

    import QtQuick
    import QtQuick.Controls
    import QtQuick.Layouts
    
    ApplicationWindow {
    
        visible: true
    
        TextField {
            id: field
    
            width: 300
            height: 50
    
            anchors.centerIn: parent
    
            inputMethodHints: Qt.ImhSensitiveData || Qt.ImhNoPredictiveText || Qt.ImhDigitsOnly
        }
    }
    

    When I provide any flags to inputMethodHints, they are not recognized or interacted with.

    Qt 6.7.2
    Android 10

    Result
    Screenshot_20240803_091733_org.qtproject.example.appTest1.jpg

    Additionally, sometimes I need to move the TextField down, and when I click on the input, the keyboard comes up over the input, making it invisible. I read that setting an adjustPan variable in the Android manifest file would fix this, but it didn’t work for me. Does anyone have any ideas?

    M 1 Reply Last reply
    1
    • O omerfurkan

      Hello, I’m developing an application for Android with Qt6, but I’ve encountered a few strange issues while using TextField. The TextField doesn’t seem to read any input method hints flags at all.

      Code

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
      
          visible: true
      
          TextField {
              id: field
      
              width: 300
              height: 50
      
              anchors.centerIn: parent
      
              inputMethodHints: Qt.ImhSensitiveData || Qt.ImhNoPredictiveText || Qt.ImhDigitsOnly
          }
      }
      

      When I provide any flags to inputMethodHints, they are not recognized or interacted with.

      Qt 6.7.2
      Android 10

      Result
      Screenshot_20240803_091733_org.qtproject.example.appTest1.jpg

      Additionally, sometimes I need to move the TextField down, and when I click on the input, the keyboard comes up over the input, making it invisible. I read that setting an adjustPan variable in the Android manifest file would fix this, but it didn’t work for me. Does anyone have any ideas?

      M Offline
      M Offline
      mv-whw
      wrote on last edited by mv-whw
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • KH-219DesignK Offline
        KH-219DesignK Offline
        KH-219Design
        wrote on last edited by
        #3

        I don't have any knowledge to contribute about inputMethodHints.

        But for the keyboard-covers-input issue, I think that is the known qt-android bug: https://bugreports.qt.io/browse/QTBUG-125323

        www.219design.com
        Software | Electrical | Mechanical | Product Design

        1 Reply Last reply
        0
        • O Offline
          O Offline
          omerfurkan
          wrote on last edited by omerfurkan
          #4

          Is Qt a balloon? Working with Qt on Android has been a struggle for a year. I downloaded Qt 6.8, and this issue still hasn't been resolved. Can you believe it? It'll be 2025. Qt 6.8 has been released, and we still can't use input on Android? I used to enjoy developing with Qt, but I'm starting to wonder if I learned it for nothing.

          I'm using Qt 6.8 and I've created an Android application for testing, which includes a TextField. When I click on the TextField, the keyboard comes over the input, and I can't see what is being typed.

          1 Reply Last reply
          1

          • Login

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