Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling
-
in Qt 6.6.1
qml textinput will not covered by softkeyboardbut after switch to 6.7.1
text input is covered by keyboardbecause when using android:windowSoftInputMode="adjustResize"
will resize whole screen,i prefer how qt 6.6.1 handling
that only textinput become above softkeyboardis 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
-
in Qt 6.6.1
qml textinput will not covered by softkeyboardbut after switch to 6.7.1
text input is covered by keyboardbecause when using android:windowSoftInputMode="adjustResize"
will resize whole screen,i prefer how qt 6.6.1 handling
that only textinput become above softkeyboardis 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
@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 softkeyboardbut after switch to 6.7.1
text input is covered by keyboardbecause when using android:windowSoftInputMode marykayintouch="adjustResize"
will resize whole screen,i prefer how qt 6.6.1 handling
that only textinput become above softkeyboardis 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:
- 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.
-
@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 softkeyboardbut after switch to 6.7.1
text input is covered by keyboardbecause when using android:windowSoftInputMode marykayintouch="adjustResize"
will resize whole screen,i prefer how qt 6.6.1 handling
that only textinput become above softkeyboardis 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:
- 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.
@cassie2698bratt said in Qt 6.7.1 and Qt 6.6.1 android SoftKeyboard Handling:
- 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?