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. QML TextInput and native Keyboard issues

QML TextInput and native Keyboard issues

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 1.1k Views
  • 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.
  • J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #1

    Hi everyone,

    I'm facing some issues with TextInput item (QML) and Android

    the input method hint is set to

    inputMethodHints: Qt.ImhFormattedNumbersOnly this works fine. At least on android afaik, it's a known bug that the wrong numpad is called on ios- the one without the minus sign.

    I also do the following calls when the item gets the focus:

              onFocusChanged:{
                    if(focus){
                        focusIn()
                        cursorPosition = 0
                        selectAll()
                        forceActiveFocus()
                        Qt.inputMethod.show()
                    }
                }
    
    1. The problem arises when the textinput gets the focus. Sometimes, and frustratingly not always, an actionbar appears at the top of the screen with copy&past and cutout buttons. This was not the case in Qt 5.7 but it started to appear when I upgraded the app to 5.9 and still exists in 5.11.
      Is there any way to prevent that actionbar to appear? Do I need to write my own call to the nativ keypad, or do I have to create my own virtual keyboard. I would love to use QtVirtualKeyboard modul but that does not exists, out of the box, for android or ios.

    2. When the Keyboard appears, a resize event is triggered, that reduces the height of the screen by a factor of 2. I'm confused by that. I thought the native behaviour would be, to shift the whole app screen, when the focused item would be hidden by the keypad or do nothing when it's not. This forces a flashing of the screen (flash to white and back) and resizes elements to aspect ratios they were'nt desigend for.
      I can force it by setting a minimal size or fixed one to the widgets, but that more or less destroys any dynamic resizing for different screen sizes (differen phones and tablets). The same as problem 1 this is also inconsistent, 50% of all times this happens and 50% it does not.

    Anyone has any suggestions / solutions for these 2 problems?

    I should mention, in case it is relevant, this QML object is part of a QQuickWidget, that lives inside a QMainWindow. The whole work i'm doing is supposed to be an upgrade for legacy code, thats the reason for this approach.

    Greetings.


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    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