QML ist mostly “just” JavaScript, and JS has dynamic objects. so the code is valid if you try something like this:
var obj = {} // empty object
console.log(obj.foo)
obj.foo is valid code, it will just be undefined and that is why your code shows no warnings or error, you just try accessing a property that is not there and Qt will convert “undefined” to 0 if the target type in c++ is an int :)
↧