Le lun. 31 mai 2021 à 19:59, Alexander Dyagilev <alervd...@gmail.com> a écrit :
> Hello, > > Am I right that this is not possible in QML? > > readonly property var mainTbImg: { > up: "some string", > up_check: "some another string" > } > The problem is that QML doesn't know how to parse it, it can't know if it's a JS statement or a JS object definition. To disambiguate it you can either write: readonly property var mainTbImg: ({ up: "some string", up_check: "some another string" }) or : readonly property var mainTbImg: { "up": "some string", "up_check": "some another string" } Encompass the declaration with parenthesis or the property names with double quotes.
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest