are you sure that worked before? I could never get it to work to assign objects to properties directly. I thought that is a feature of QML and the {} are parsed as a function like you do with slots (onClicked: {} is a slot and not an JS object as far as I know).
So with Qt 5.2 and 5.2.1 it is a QMl syntax error to do something like
property var foo: {}
or do you have to use variant in that case? I thought you should always use “var” instead of variant in newer version of Qt?
anyway my solution is to use a helper function that always works:
property var foo: getFoo()
function getFoo() {
return { ... }
}
↧