Dear all,
I’m learning Quick. In a simple application, I try to update the text of a label when a button is pressed. I’m not able to update the text but the application crashes (qt 5.2.2).
How can I fix the problem?
Joaquim Duran
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
Rectangle {
id: root
width: 800
height: 480
ToolBar {
id: toolbar
RowLayout {
Button {
id: writer
text: qsTr("Write")
onClicked: label1.text = "button pressed"
}
Button {
id: clear
text: qsTr("Clear")
onClicked: label1.text = ""
}
Button {
id: close
text: qsTr("Close")
onClicked: Qt.quit();
}
Text {
id: label1
text: qsTr("text of label")
}
}
}
}
↧