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 TextEdit: issues while writing
QtWS25 Last Chance

QML TextEdit: issues while writing

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 2.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.
  • S Offline
    S Offline
    spode
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      chriadam
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        spode
        wrote on last edited by
        #3

        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
        0
        • S Offline
          S Offline
          spode
          wrote on last edited by
          #4

          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
          0
          • C Offline
            C Offline
            chriadam
            wrote on last edited by
            #5

            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
            0
            • S Offline
              S Offline
              spode
              wrote on last edited by
              #6

              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
              0

              • Login

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