Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18407

TextInput dialog in QML gives empty though user has typed some name by actiavting predictive search

    XMLWordPrintable

Details

    Description

      When user wants to enter name through softwareInputPanel in portrait mode by activating predictive search and types a name which is not there in dictionary and enters(say the text input is still underlined) and the same name comes in the user's input dialog with the underlined name but textInput.text() API gives empty name.
      This has been seen in Phone. Here is the code snippet.

      Rectangle{
          id:textInputRect
          x:10
          y:60
          width: 200
          height: 35
          radius:6
          TextInput{
              id: textInput
              text: "unKnown"
              anchors.fill: parent
              activeFocusOnPress: false
              font.pixelSize: 27;
              MouseArea {
                  anchors.fill: parent
                  onClicked: {
                      if (!textInput.activeFocus) {
                          textInput.forceActiveFocus();
                          textInput.text = "";
                          textInput.openSoftwareInputPanel();
                      } else {
                          textInput.focus = false;
                      }
                  }
              }
          }
          Button{
              id:ok
              x:300
              y:300
              width:130
              height:50
              color:'green'
              radius:6
              text: "Ok"
              
              MouseArea{
                  anchors.fill: parent;
                  onPressed:{
                      button.color = "lightgreen"
                  }
                  onReleased:{
                      button.color = "green"
                      textInput.closeSoftwareInputPanel();
                      currentName =   textInput.text.substring(0,15)
                      if(currentName == ""){
                          currentName = "unKnown"
                      }
                      //Save it as highscore
                      highScores.savePlayerScore(currentName,item.score);
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            krishkn krishna k n
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes