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. auto-open keybord for first listview textinput item
Forum Update on Monday, May 27th 2025

auto-open keybord for first listview textinput item

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 234 Views
  • 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.
  • A Offline
    A Offline
    armin2
    wrote on last edited by
    #1

    hi,

    i try to programatically open android‘s keyboard after my dialog opened.
    that dialog contains a list view, that holds a delegate, that contains of rectangles and textinputs.

    what‘s the qml way of auto-showing keyboard and allowing users text input to be put into first textinput in list?

    i already managed opening keyboard by showKeyboard() but it does not put characters into any textviews...

    regards, armin

    ODБOïO 1 Reply Last reply
    0
    • A armin2

      hi,

      i try to programatically open android‘s keyboard after my dialog opened.
      that dialog contains a list view, that holds a delegate, that contains of rectangles and textinputs.

      what‘s the qml way of auto-showing keyboard and allowing users text input to be put into first textinput in list?

      i already managed opening keyboard by showKeyboard() but it does not put characters into any textviews...

      regards, armin

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @armin2 hi
      make sure your text input has focus property set to true

      TextInput {
        id: textInput
        focus: true
      }
      
      1 Reply Last reply
      1
      • A Offline
        A Offline
        armin2
        wrote on last edited by
        #3

        focus is set, but doesnt work. keystrokes just get lost.

        J.HilkJ 1 Reply Last reply
        0
        • A armin2

          focus is set, but doesnt work. keystrokes just get lost.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @armin2

          ListView {
              id:myView
              Component.onCompleted: {
                   var firstItem = myView.itemAtIndex(0)
                   if(firstItem)
                       firstItem.forceActiveFocus()
              }
              ......
              ....
          }
          

          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0

          • Login

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