Solved Qt Virtualkeyboard enter key on textfield
-
When i press the enter key on a Textfield, the Virtualkeyboard will hide.
Is there a way to change this? What i want is when the enter key is pressed than should activate the next textfield like this:TextField { id: fnameField KeyNavigation.tab: titleField maximumLength:21 Keys.onEnterPressed: { titleField.forceActiveFocus() } }
But this doenst work, the inputmethod will hide.
-
You can use input method hits for that. http://doc.qt.io/qt-5/qml-qtquick-textinput.html#inputMethodHints-prop See the description for Qt.ImhMultiLine.
-
Thanks that worked! So i change it a little bit and now it looks like this:
TextField { id: fnameField KeyNavigation.tab: titleField maximumLength:21 inputMethodHints: Qt.ImhMultiLine Keys.onReturnPressed: { titleField.forceActiveFocus() } }