Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Application crash when updating the text of a label.

$
0
0
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")             }         }     } }

Viewing all articles
Browse latest Browse all 4972

Trending Articles