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. QML Virtual keyboard Hide button not working.
QtWS25 Last Chance

QML Virtual keyboard Hide button not working.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlqtquick2keyboard
3 Posts 2 Posters 3.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.
  • P Offline
    P Offline
    Praveen_2017
    wrote on 20 Aug 2017, 16:25 last edited by
    #1

    Hello , I am having a problem if I click on keyboard hide button .Following is the code :

    import QtQuick 2.6
    import QtQuick.Window 2.2
    import QtQuick.Controls 2.2
    import QtQuick.VirtualKeyboard 2.2
    
    Window {
        visible: true
        width: 600
        height: 500
        title: qsTr("Hello World")
    
        TextField {
            id: textfield
            anchors.bottom:(inputPanel.visible) ? inputPanel.top : parent.bottom
            color: "#2B2C2E"
            cursorVisible: activeFocus
            selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15)
            selectedTextColor: color
        }
    
        InputPanel {
            id: inputPanel
            z: 89
            anchors.bottom:parent.bottom
            anchors.left: parent.left
            anchors.right: parent.right
    
            visible: Qt.inputMethod.visible //** Warning here 
    
        }
    }
    

    Below are the use-cases:

    1. If i click on TextField keyboard pops as expected but when I click on hide keyboard button it's not hiding.

    2. If i click on TextField keyboard pops as expected, next if I double-click on TextField and then click on hide keyboard button it's hiding.

    I am also getting a warning as :

    QML InputPanel: Binding loop detected for property "visible"
    

    Please suggest.

    R 1 Reply Last reply 21 Aug 2017, 07:47
    1
    • P Praveen_2017
      20 Aug 2017, 16:25

      Hello , I am having a problem if I click on keyboard hide button .Following is the code :

      import QtQuick 2.6
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.2
      import QtQuick.VirtualKeyboard 2.2
      
      Window {
          visible: true
          width: 600
          height: 500
          title: qsTr("Hello World")
      
          TextField {
              id: textfield
              anchors.bottom:(inputPanel.visible) ? inputPanel.top : parent.bottom
              color: "#2B2C2E"
              cursorVisible: activeFocus
              selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15)
              selectedTextColor: color
          }
      
          InputPanel {
              id: inputPanel
              z: 89
              anchors.bottom:parent.bottom
              anchors.left: parent.left
              anchors.right: parent.right
      
              visible: Qt.inputMethod.visible //** Warning here 
      
          }
      }
      

      Below are the use-cases:

      1. If i click on TextField keyboard pops as expected but when I click on hide keyboard button it's not hiding.

      2. If i click on TextField keyboard pops as expected, next if I double-click on TextField and then click on hide keyboard button it's hiding.

      I am also getting a warning as :

      QML InputPanel: Binding loop detected for property "visible"
      

      Please suggest.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 21 Aug 2017, 07:47 last edited by
      #2

      @Praveen_2017 said in QML Virtual keyboard Hide button not working.:

      visible: Qt.inputMethod.visible //** Warning here

      I do not have any experience with QtVirtualKeyboard yet, but here are my thoughts:
      i think this line isn't needed at all?! If at all you should use the active property.
      What happens if you just remove that line?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      P 1 Reply Last reply 21 Aug 2017, 15:37
      0
      • R raven-worx
        21 Aug 2017, 07:47

        @Praveen_2017 said in QML Virtual keyboard Hide button not working.:

        visible: Qt.inputMethod.visible //** Warning here

        I do not have any experience with QtVirtualKeyboard yet, but here are my thoughts:
        i think this line isn't needed at all?! If at all you should use the active property.
        What happens if you just remove that line?

        P Offline
        P Offline
        Praveen_2017
        wrote on 21 Aug 2017, 15:37 last edited by
        #3

        @raven-worx If I remove the line, the keyboard will never hide and the reason for adding visible: Qt.inputMethod.visible is because of the following line that I found in an example :

        /*  The visibility of the InputPanel can be bound to the Qt.inputMethod.visible property, but then the handwriting input panel and the keyboard input panel can be visible at the same time. Here the visibility is bound to InputPanel.active property instead, which allows the handwriting panel to control the visibility when necessary. */
        

        Bad luck is that it's nowhere mentioned in any docs.

        1 Reply Last reply
        1

        1/3

        20 Aug 2017, 16:25

        • Login

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