Nominate our 2022 Qt Champions!

QML TextEdit: issues while writing

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

    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

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


  • 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?

  • 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

  • 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! =)

  • 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.


  • 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 :)

Log in to reply