私はQMLにコードスニペットを持っていますが、これはscreen.textで正規表現 "Calling"を探し、見つからなければ変更しますscreen.text.残念ながら、ドキュメントはQML/QString documentationでは明確ではありません。はQMLのQstring /文字列にある可能性のあるもの(regexp)を含んでいます
Button{
id: call
anchors.top: seven.bottom
anchors.left: seven.left
text: "Call"
width: 40
onClicked:{
if(screen.text.toString().startsWith("Calling" , false))
return;
else
screen.text = "Calling " + screen.text
}
}
私が手にエラーがある:
file:///home/arnab/workspace/desktop/examples/cellphone.qml:127: TypeError: Result of expression 'screen.text.toString().startsWith' [undefined] is not a function.