界面显示保留n位小数
Label{
width:20
text :(10/5).toFixed(4)
}
界面显示为2.0000
输入进行int验证
TextField{
width: 20
height: 10
text: 8
validator: IntValidator{
bottom : 0 //min
top : 100 //max
}
onEditingFinished: {
console.log("Edit finish,do something you want.")
}
}
输入进行float验证
TextField{
width: 20
height: 10
text: 8.0
validator: DoubleValidator{
decimals : 2 //保留小数点位数
bottom : 0 //最小值
top : 1000 //最大值
notation : DoubleValidator.StandardNotation
}
}