Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML - Display "Next" button to move to next TextField on a mobile keyboard

How can I force my keyboard layout to display the "Next" button in QML ? ( Like in a standard HTML form ) I don't want to display a "OK" button ( which means that you're about to validate the form .. )

like image 961
Geoffroy Avatar asked Mar 26 '15 07:03

Geoffroy


2 Answers

You can use the EnterKey attached property introduced in Qt 5.6:

import QtQuick 2.6

TextInput {
    EnterKey.type: Qt.EnterKeyNext
}
like image 138
jpnurmi Avatar answered Oct 17 '22 14:10

jpnurmi


TextInput {
    id: txtInput  
    Component.onCompleted: {  
    EnterKeyAction.actionId = EnterKeyAction.Next  
    EnterKeyAction.label = "Next"  
    } 
}
like image 38
Hoàng Hiệp Nguyễn Avatar answered Oct 17 '22 16:10

Hoàng Hiệp Nguyễn