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. -
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.
-
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? -
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 thisTextInput { 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! -
@edoardo.videx said in Problem with QML Android VirtualKeyBoard:
activeFocusOnPress: true
focus: truetry 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?
-
Great. Happy coding! :-)
-
@edoardo-videx said in Problem with QML Android VirtualKeyBoard:
activeFocusOnPress: true
write a small test program and the keyboard pops up nicely. But it does not show up when TextInput is added into a large project. Weird.