我对QML很新颖。根据QML文档http://doc.qt.nokia.com/4.7-snapshot/qdeclarativescope.html,Text对象应该显示15,但是它只输出5.任何人都可以帮我解决问题吗?QML中的基本Javascript /数学...它为什么不起作用?
Text {
id: counter
x: 300;
y: 300;
property int a: 5;
function randNumber(a){
var a = a+10;
return a;
}
text: a;
}
很多'a'! –