Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Android QML: Close virtual keyboard
Forum Update on Monday, May 27th 2025

[SOLVED] Android QML: Close virtual keyboard

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 14.6k 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
    AcerExtensa
    wrote on 4 Sept 2013, 11:19 last edited by
    #1

    Hello,
    Have following situation:
    i have simple QML with TextInput as an search field and ListView with elements.
    If I click in TextInput it gts focused and virtual keyboard gets shown. but if I click back on ListView(or it element) keyboard doesn't hides.. actually the focus is still on TextInput(why?), I have tried to set focus to ListView explicitly with item_list.forceActiveFocus();, Textinupt lost its focus, but keyboard is still there....

    How can I hide virtual keyboard? Thanks for any suggestion!

    God is Real unless explicitly declared as Integer.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on 4 Sept 2013, 11:29 last edited by
      #2

      OK, i found it out.
      @
      TextInput
      {
      id: text_input1
      anchors.fill: parent
      font.pixelSize: parent.height-4
      text: qsTr("")
      Keys.onReturnPressed:
      {
      // item_list.focus = true;
      Qt.inputMethod.hide();
      }
      }
      @

      It was hard to find it out... Nothing is said in Qt5 documentation.... Found this on QTBUG tracker....

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      2
      • A Offline
        A Offline
        AlterX
        wrote on 23 Nov 2013, 11:12 last edited by
        #3

        [quote author="AcerExtensa" date="1378294171"]OK, i found it out.

                        Qt.inputMethod.hide();
        

        [/quote]

        Just to avoid to get crazy, on 5.1.1 you have to use without Qt voice:
        @
        inputMethod.hide()
        @

        I hope, from now on, it will be always this one...

        Qt Ambassador
        Real-time cooperative teams: http://www.softairrealfight.net
        Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

        https://codereview.qt-project.org/...

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AlterX
          wrote on 23 Nov 2013, 11:34 last edited by
          #4

          [quote author="AlterX" date="1385205120"]
          Just to avoid to get crazy, on 5.1.1 you have to use without Qt voice:
          @
          inputMethod.hide()
          @

          I hope, from now on, it will be always this one...
          [/quote]

          Sorry, it was my fault...QtCreator 3 beta doesn't recognize inputMethod under Qt object

          Qt Ambassador
          Real-time cooperative teams: http://www.softairrealfight.net
          Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

          https://codereview.qt-project.org/...

          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