[SOLVED] Android QML: Close virtual keyboard



  • Hello,
    Have following situation:
    i have simple QML with TextInput as an search field and ListView with elements.
    If I click in TextInput it gts focused and virtual keyboard gets shown. but if I click back on ListView(or it element) keyboard doesn't hides.. actually the focus is still on TextInput(why?), I have tried to set focus to ListView explicitly with item_list.forceActiveFocus();, Textinupt lost its focus, but keyboard is still there....

    How can I hide virtual keyboard? Thanks for any suggestion!



  • OK, i found it out.
    @
    TextInput
    {
    id: text_input1
    anchors.fill: parent
    font.pixelSize: parent.height-4
    text: qsTr("")
    Keys.onReturnPressed:
    {
    // item_list.focus = true;
    Qt.inputMethod.hide();
    }
    }
    @

    It was hard to find it out... Nothing is said in Qt5 documentation.... Found this on QTBUG tracker....



  • [quote author="AcerExtensa" date="1378294171"]OK, i found it out.

                    Qt.inputMethod.hide();
    

    [/quote]

    Just to avoid to get crazy, on 5.1.1 you have to use without Qt voice:
    @
    inputMethod.hide()
    @

    I hope, from now on, it will be always this one...



  • [quote author="AlterX" date="1385205120"]
    Just to avoid to get crazy, on 5.1.1 you have to use without Qt voice:
    @
    inputMethod.hide()
    @

    I hope, from now on, it will be always this one...
    [/quote]

    Sorry, it was my fault...QtCreator 3 beta doesn't recognize inputMethod under Qt object


Log in to reply
 

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