javascript function in QML
Unsolved
QML and Qt Quick
-
Why I'm not getting the desired result in the following code?
Item { id: root width: 200 height: 200 function foo() { var l = 2+2; } Component.onCompleted: { var str = foo.toString(); console.log(str) } }
It's giving me
function() { [code] }
rather thenfunction foo() { var l = 2+2; }
.What's the reason for such behaviour?