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 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling
Forum Updated to NodeBB v4.3 + New Features

Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling

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

    in Qt 6.6.1
    qml textinput will not covered by softkeyboard

    but after switch to 6.7.1
    text input is covered by keyboard

    because when using android:windowSoftInputMode="adjustResize"
    will resize whole screen,

    i prefer how qt 6.6.1 handling
    that only textinput become above softkeyboard

    is there workarround in 6.7.1?
    why such nice feature in 6.6.1 is removed in 6.7.1?

    note, im not doing hacky in qml,qt code and android code never changed

    C 1 Reply Last reply
    1
    • Q QoTia

      in Qt 6.6.1
      qml textinput will not covered by softkeyboard

      but after switch to 6.7.1
      text input is covered by keyboard

      because when using android:windowSoftInputMode="adjustResize"
      will resize whole screen,

      i prefer how qt 6.6.1 handling
      that only textinput become above softkeyboard

      is there workarround in 6.7.1?
      why such nice feature in 6.6.1 is removed in 6.7.1?

      note, im not doing hacky in qml,qt code and android code never changed

      C Offline
      C Offline
      cassie2698bratt
      wrote on last edited by
      #2

      @QoTia said in Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling:

      in Qt 6.6.1
      qml textinput will not covered by softkeyboard

      but after switch to 6.7.1
      text input is covered by keyboard

      because when using android:windowSoftInputMode marykayintouch="adjustResize"
      will resize whole screen,

      i prefer how qt 6.6.1 handling
      that only textinput become above softkeyboard

      is there workarround in 6.7.1?
      why such nice feature in 6.6.1 is removed in 6.7.1?

      note, im not doing hacky in qml,qt code and android code never changed

      Hello,

      You're right, the default behavior of android:windowSoftInputMode="adjustResize" in Qt 6.7.1 might not be ideal for your situation. Here are some workarounds you can try to achieve the desired behavior in Qt 6.7.1:

      1. Using android:windowSoftInputMode="adjustPan:

      This option instructs the system to try to pan the layout upwards to reveal the text input instead of resizing the entire screen. This might be closer to the behavior you experienced in Qt 6.6.1.
      2. Customizing Layout with Window.setSoftKeyboardHandling:

      Qt provides the Window.setSoftKeyboardHandling property to define how the application window reacts to the software keyboard.
      Setting it to Window.SoftKeyboardHandling.StayOnTop might keep the text input above the keyboard while potentially requiring some adjustments to ensure other UI elements remain accessible.
      3. Signal/Slot Approach:

      You can use Qt's signal-slot mechanism to react to the keyboard visibility.
      Connect to the Qt.Application::keyboardOrientationChanged signal.
      In the connected slot, adjust the layout of your QML elements based on the keyboard orientation and visibility.
      4. Platform-Specific Code (Optional):

      If the above options don't provide a satisfactory solution, you might consider exploring platform-specific code (Android Java/Kotlin) to directly control the soft keyboard behavior. However, this approach can be more complex and requires managing the interaction between Qt and the native platform.
      Understanding the Change:

      The specific reason for the behavioral change between Qt 6.6.1 and 6.7.1 might not be explicitly documented. However, it could be related to:

      Improvements in handling different keyboard layouts and sizes.
      Ensuring compatibility with newer Android versions.
      Addressing reported issues with the previous behavior.
      It's important to note that Qt versions often introduce changes and bug fixes. While not perfect in every scenario, the newer version might offer overall improvements in keyboard handling across various devices and Android versions.

      Try the suggested workarounds, particularly android:windowSoftInputMode="adjustPan" and Window.setSoftKeyboardHandling. They might provide a simpler solution closer to the desired behavior. If those options don't work, consider exploring the platform-specific approach but be aware of the increased complexity.

      I hope the information may help you.

      A 1 Reply Last reply
      0
      • C cassie2698bratt

        @QoTia said in Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling:

        in Qt 6.6.1
        qml textinput will not covered by softkeyboard

        but after switch to 6.7.1
        text input is covered by keyboard

        because when using android:windowSoftInputMode marykayintouch="adjustResize"
        will resize whole screen,

        i prefer how qt 6.6.1 handling
        that only textinput become above softkeyboard

        is there workarround in 6.7.1?
        why such nice feature in 6.6.1 is removed in 6.7.1?

        note, im not doing hacky in qml,qt code and android code never changed

        Hello,

        You're right, the default behavior of android:windowSoftInputMode="adjustResize" in Qt 6.7.1 might not be ideal for your situation. Here are some workarounds you can try to achieve the desired behavior in Qt 6.7.1:

        1. Using android:windowSoftInputMode="adjustPan:

        This option instructs the system to try to pan the layout upwards to reveal the text input instead of resizing the entire screen. This might be closer to the behavior you experienced in Qt 6.6.1.
        2. Customizing Layout with Window.setSoftKeyboardHandling:

        Qt provides the Window.setSoftKeyboardHandling property to define how the application window reacts to the software keyboard.
        Setting it to Window.SoftKeyboardHandling.StayOnTop might keep the text input above the keyboard while potentially requiring some adjustments to ensure other UI elements remain accessible.
        3. Signal/Slot Approach:

        You can use Qt's signal-slot mechanism to react to the keyboard visibility.
        Connect to the Qt.Application::keyboardOrientationChanged signal.
        In the connected slot, adjust the layout of your QML elements based on the keyboard orientation and visibility.
        4. Platform-Specific Code (Optional):

        If the above options don't provide a satisfactory solution, you might consider exploring platform-specific code (Android Java/Kotlin) to directly control the soft keyboard behavior. However, this approach can be more complex and requires managing the interaction between Qt and the native platform.
        Understanding the Change:

        The specific reason for the behavioral change between Qt 6.6.1 and 6.7.1 might not be explicitly documented. However, it could be related to:

        Improvements in handling different keyboard layouts and sizes.
        Ensuring compatibility with newer Android versions.
        Addressing reported issues with the previous behavior.
        It's important to note that Qt versions often introduce changes and bug fixes. While not perfect in every scenario, the newer version might offer overall improvements in keyboard handling across various devices and Android versions.

        Try the suggested workarounds, particularly android:windowSoftInputMode="adjustPan" and Window.setSoftKeyboardHandling. They might provide a simpler solution closer to the desired behavior. If those options don't work, consider exploring the platform-specific approach but be aware of the increased complexity.

        I hope the information may help you.

        A Offline
        A Offline
        Anumas
        wrote on last edited by
        #3

        @cassie2698bratt said in Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling:

        1. Customizing Layout with Window.setSoftKeyboardHandling:

        Qt provides the Window.setSoftKeyboardHandling property to define how the application window reacts to the software keyboard.
        Setting it to Window.SoftKeyboardHandling.StayOnTop might keep the text input above the keyboard while potentially requiring some adjustments to ensure other UI elements remain accessible.

        Hi @cassie2698bratt can you, please, provide the link to the docs where this is mentioned?

        Say hello to a bright day.-

        Anumas.

        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