Virtual keyboard doesn't open although it exists when focusing TextInput or TextEdit elements.



  • Hi,

    I'm trying to open the virtual keyboard when my TextInput element gets focus, but nothing happens.

    To clarify what I try to do the following code snippet:
    @

    TextInput {
    id: inputName
    text: (inputName.activeFocus) ? "" : qsTr("Please insert some text...")
    activeFocusOnPress: false
    height: 20
    width: 200

    MouseArea {
        anchors.fill: parent
        onClicked: {
            if(!inputName.activeFocus){
                inputName.forceActiveFocus();
                inputName.openSoftwareInputPanel();
            } else {
                inputName.focus = false;
            }
        }
        onPressAndHold: inputName.closeSoftwareInputPanel();
    

    }
    anchors.fill: parent
    }
    @

    The code is just the same as described on this page: http://doc-snapshot.qt-project.org/4.8/qml-textinput.html#openSoftwareInputPanel-method



  • Ciao xardas008
    I'm not a guru, but had the same problem. I almost solved it with something like the following:
    @Rectangle {
    id: lineEdit
    property alias text: input.text
    [...]

    TextInput {
        id: input
        text: "text here"
        [...]
    }
    
    MouseArea {
        anchors.fill: parent
        onClicked: {
            input.focus = true
            input.openSoftwareInputPanel();
        }
    }
    
    
    Keys.onReturnPressed: {
        lineEdit.focus = true
        input.closeSoftwareInputPanel();
    }
    
    Keys.onEnterPressed: {
        lineEdit.focus = true
        input.closeSoftwareInputPanel();
    }
    

    }@

    with openSoftwareInputPanel() you can force the show up of the virtual keyboard
    It seems to work on Symbian Belle, Anna and S60 5th but only on latest SW releases.

    Hope this trick works for you as well. I found it somewhere on the forum but cannot find it anymore
    bye



  • This is not very different from my aproach and doesnt work, too. Maybe I need another way on win7 or linux to open a virtual keyboard?



  • Sorry
    my mistake, but this works on mobile solution not on desktop as far as I know.
    I have no idea, but a virtual keyboard in window should be a process that you can launch... if you find the name for the program you run it maybe



  • I just created a Meego app using the Qt Simulator and there it doesn't work, too.

    Maybe it doesn't work in Qt 4.8?


Log in to reply
 

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