Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Virtualkeyboard enter key on textfield
Forum Updated to NodeBB v4.3 + New Features

Qt Virtualkeyboard enter key on textfield

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • michaelLM Offline
    michaelLM Offline
    michaelL
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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.

      (Z(:^

      1 Reply Last reply
      1
      • michaelLM Offline
        michaelLM Offline
        michaelL
        wrote on last edited by
        #3

        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()
                }
        }
        
        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved