I am quite new to Qt Quick.
I would love to have an object with editable text, that can also have onClicked function.
Here is a simple example, of what I would like to do:
TextField {
id: myTextField
text: qsTr("enter text here")
font.pixelSize: 12
onClicked: {
myText.text = "TextField edited"
}
}
Text {
id: myText
font.pixelSize: 12
}
You have to use MouseArea
:
TextField {
id: myTextField
text: qsTr("enter text here")
font.pixelSize: 12
MouseArea{
anchors.fill: parent
onClicked: myText.text = "TextField edited"
}
}
Text {
id: myText
font.pixelSize: 12
}