如何清除TextField
黑莓中的?这是qml:
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
leftPadding: 75
rightPadding: leftPadding
bottomPadding: 40
TextField {
id: tfComment
hintText: qsTr("add comment")
inputMode: TextFieldInputMode.Text
input {
submitKey: SubmitKey.Submit
onSubmitted: {
cppObj.onCommentSubmitClicked(tfComment.text, "");
lComment.text = tfComment.text;
}
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
bottomPadding: 200
leftPadding: 20
rightPadding: leftPadding
Label {
id: lComment
verticalAlignment: VerticalAlignment.Bottom
horizontalAlignment: HorizontalAlignment.Center
text: cppObj.desc
}
}
我想清除输入到的数据,TextField
以便我有空间评论另一个。我怎么做?