Showing Android keyboard from QML TextField
Hi to all!
Inside my Qt/QML app, based on Qt 5.5.1 Opensource Edition, which is being ported from 64bit Ubuntu 14.04 LTS to Android I have QML TextField entity. Now, when the user selects it using toucscreen on Samsung Tab 3 10.1, the Android virtual keyboard should pop up, but it does not.
Is it possible to popup android virtual keyboard using Qt Opensource edition at all or is it possible to pop up Qt virtual keyboard only and therefore I need Qt payed edition? If the first option is possible, then here is my sample code:
Code:
TextField
{
width: 384
height: 128
placeholderText: qsTr("Android keyboard test")
focus: true
onTextChanged:
{
print("Text changed");
} // onTextChanged
} // TextField
Re: Showing Android keyboard from QML TextField
The Qt virtual keyboard is intended for systems that don't have a virtual keyboard.
I doubt it would even work on Android which already has one.
Have you tried "forceActiveFocus()" instead of setting the focus property?
Is the QGuiApplicaton::focusObject() the element you think it is?
Cheers,
_
Re: Showing Android keyboard from QML TextField
I've upgraded code to:
Code:
TextField
{
width: 384
height: 128
placeholderText: qsTr("Android keyboard test")
focus: true
onTextChanged:
{
print("Text changed");
} // onTextChanged
MouseArea
{
anchors.fill: parent
onClicked:
{
print("clicked");
forceActiveFocus(Qt.MouseFocusReason);
Qt.inputMethod.show();
} // onClicked
} // MouseArea
} // TextField
Debug message "clicked" gets printed out once I touch onto TextField's area, but keyboard is not visible!
Sincerely,
Marko
Re: Showing Android keyboard from QML TextField
Never used TextField but I have an Android app where I use TextInput and it works "out of the box".
Re: Showing Android keyboard from QML TextField
Quote:
Originally Posted by
MarkoSan
Code:
MouseArea
{
anchors.fill: parent
onClicked:
{
print("clicked");
forceActiveFocus(Qt.MouseFocusReason);
Qt.inputMethod.show();
} // onClicked
} // MouseArea
} // TextField
Why would you wan the MouseAra to have keyboard focus?
Cheers,
_