Cursor visible even after focus is shifted to next text field and previous textfield's focus is made false



  • When i am testing my code in android device, i am getting UI as below;
    0_1542969082216_4f907c51-a359-4c02-a4fa-f76bee36a020-image.png
    Why this cursor symbol is visible in each text field even after jumping to next Textfield?
    In some other android devices its working fine. Cursor symbol is not visible after each input.
    For Desktop also its working fine.
    Why this is happening?

    My code looks like :
    Textfield{
    id: id_textfield1
    onTextChanged:
    {
    id_textfield2.focus = true
    id_textfield1.focus = false
    }
    }
    Textfield{
    id: id_textfield2
    onTextChanged:
    {
    id_textfield3.focus = true
    id_textfield2.focus = false
    }
    }



  • Are you sure this works on any system? You are setting the focus on id_textfield1 etc..., but the fields have ids txt1 etc...

    It is not uncommon for some versions of Qt to have quirks with Android. (First thing to tell when discussing problems are the environment details: Qt version, Android version etc...) If you don't use a mature Qt version, like 5.something.1 or .2, I'd recommend trying with such.



  • @mvuori
    Sorry, that id written previously was a mistake. I updated that.
    I am using QT version 5.9



  • Did you try using forceActiveFocus() ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.