Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QML TextEdit: issues while writing

    QML and Qt Quick
    2
    6
    2250
    Loading More Posts
    • 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.
    • S
      spode last edited by

      can anyone explain to me the reason why this textedit does not write (when keys are pressed) please?

      @
      TextEdit
      {
      readOnly: false
      text: testoManifesto
      anchors.centerIn: parent
      id: txtEdit
      font.pointSize: 16
      Keys.onBackPressed: if(txtEdit.text == "") txtEdit.text = "Scrivi ciò che ti interessa cercare!"; else txtEdit.text = txtEdit.text
      Keys.onPressed: if(txtEdit.text == "Scrivi ciò che ti interessa cercare!") txtEdit.text = ""; else txtEdit.text = txtEdit.text
      }

                      MouseArea
                      {
                          anchors.fill: parent
                          hoverEnabled: true
                          onEntered: { parent.border.color = "green"; testo_aiuto = guida }
                          onExited: { parent.border.color = "red"; testo_aiuto = guidaDefault }
                          onClicked: {
                              if(readOnly)
                                  listElementClicked(funzione, txtEdit.text)
                              else //www o internet
                                  if(txtEdit.text.search(funzione))
                                  {
                                      txtEdit.text = "Scrivi ciò che ti interessa cercare!"
                                      txtEdit.width = 350
                                      txtEdit.height = 30
                                      txtEdit.cursorVisible = true
                                      txtEdit.focus = true;
                                  }
                                  else
                                      listElementClicked(funzione, txtEdit.text)
                          }
                      }
      

      @

      1 Reply Last reply Reply Quote 0
      • C
        chriadam last edited by

        It depends on the rest of the code in your application. Does anything else grab focus? Does something higher accept various keypress events, stopping them from being delivered to your TextEdit?

        1 Reply Last reply Reply Quote 0
        • S
          spode last edited by

          can you please control the code in my website?

          EDIT: the name of the project is "Tecnophobie" and you can find it in "Programmazione"->"Computer". thank you a lot

          1 Reply Last reply Reply Quote 0
          • S
            spode last edited by

            Please, admin, make that when a user edits a post, all the followers receive an e-mail notification. Now that you have read what i suggest, you can delete this post! =)

            1 Reply Last reply Reply Quote 0
            • C
              chriadam last edited by

              I have no idea what you mean. I cannot modify your code for you directly, no. There are only a few things which could be stopping input events from reaching your TextEdit, however, which I described in my first reply. Hopefully careful analysis of your code will tell you what is intercepting the events.

              Cheers,
              Chris.

              1 Reply Last reply Reply Quote 0
              • S
                spode last edited by

                Hi Chris. I know you cannot modify my code.
                But nothing does catch signal from keyboard in the rest of the code. I will try to solve this issue :)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post