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 Updated to NodeBB v4.3 + New Features

auto-open keybord for first listview textinput item

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 236 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 27 Oct 2019, 00:10 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

    O 1 Reply Last reply 29 Oct 2019, 13:20
    0
    • A armin2
      27 Oct 2019, 00:10

      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

      O Offline
      O Offline
      ODБOï
      wrote on 29 Oct 2019, 13:20 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 31 Oct 2019, 00:06 last edited by
        #3

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

        J 1 Reply Last reply 31 Oct 2019, 06:38
        0
        • A armin2
          31 Oct 2019, 00:06

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

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 31 Oct 2019, 06:38 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

          4/4

          31 Oct 2019, 06:38

          • Login

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