Problem with QML Android VirtualKeyBoard



  • Hi,i want create a Application for Android Mobile.
    I've a QML file where i want add a virtual keyboard. Everythings goes fine, but when i open the application the application output say:

    W/libQR_VIEWER_QML.so(22133): (null):0 ((null)): QQmlApplicationEngine failed to load component
    W/libQR_VIEWER_QML.so(22133): (null):0 ((null)): qrc:/main.qml:25 Type MainForm unavailable
    W/libQR_VIEWER_QML.so(22133): qrc:/MainForm.qml:47 Type MacBox unavailable
    W/libQR_VIEWER_QML.so(22133): qrc:/MacBox.qml:8 module "QtQuick.Virtualkeyboard" is not installed
    W/libQR_VIEWER_QML.so(22133):
    W/IInputConnectionWrapper(22133): showStatusIcon on inactive InputConnection
    

    PS.: I've a Qt5.11.2 version.

    Someone can help me??
    Thanks.


  • Moderators

    The Virtual Keyboard module is not available on Android.

    It is possible to add it to the platform plugin though and not too hard. Search around, there are some folks who have done it already.



  • @sierdzio so, how can i use a keyboard in Android?

    If I want add a text line edit(or similar in QML,like TextInput or TextField) when I touch over the object for write something, not happen nothing!! Where's the mistake?


  • Moderators

    By default, system keyboard is used on Android. So, when you set focus on TextIntput, your OS keyboard will show (GBoard, SwiftKey, Android Keyboard - whatever you have installed).

    If it does not work for you - well, I don't know. Show us your code, maybe we'll spot something.



  • @sierdzio
    this is my code:

        TextInput {
            id: mac_6
            x: 183
            y: 8
            width: 29
            height: 20
            text: qsTr("00")
            transformOrigin: Item.Center
            font.pixelSize: 12
            horizontalAlignment: Text.AlignHCenter
            activeFocusOnPress: true
            focus: true
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    mac_6.forceActiveFocus();
                    mac_6.openSoftwareInputPanel();
    
                    //Qt.inputMethod.show()
                    console.log("getPrinted")
                }
            }
        }
    

    It not work...
    @sierdzio you can help me?


  • Moderators

    Remove the mouse area. It is blocking the input. At least that's my suspicion.

    Also, seeing rigid positioning makes me wonder: are you sure you are clicking in the TextIntput? It is very tiny. Recommendation: use layouts. And switch at least to TextEdit which has some more visible GUI.



  • @sierdzio
    i do this

        TextInput {
            id: mac_6
            x: 183
            y: 8
            width: 29
            height: 20
            text: qsTr("00")
            transformOrigin: Item.Center
            font.pixelSize: 12
            horizontalAlignment: Text.AlignHCenter
            activeFocusOnPress: true
            focus: true
        }
    

    but not work yet.
    I'm sure that i touch the text input!


  • Moderators

    @edoardo.videx said in Problem with QML Android VirtualKeyBoard:

    activeFocusOnPress: true
    focus: true

    try removing these 2 lines.

    Also, try making a new, simple, "Hello world" kind of app - if it works there you'd be able to compare what you did wrong here. Perhaps you have some obsolete settings left over from your tries with Qt virtual keyboard and you need to delete them.

    OS keyboard does show in other applications on that phone, right?



  • @sierdzio I resolved the problem. I created a simple application "Hello World" and it work fine. So i analized my old code, and i found the difference casued by impelentation of Virtual KeyBoard. Thanks you so much!


  • Moderators

    Great. Happy coding! :-)


Log in to reply
 

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