<SOLVED> QtQuick.Controls: Change Focus on Enter Key

  • How can I make the focus change to the next control when the enter key is pressed for example in a TextField?

    Is there a JavaScript method to automatically focus the next control in tab order?

  • Actually it is quite easy. Just add a signal handler to the TextField:

    @TextField {
    id: txt
    Keys.onEnterPressed: {
    txt.nextItemInFocusChain(true).focus = true

Log in to reply

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