[Interest] QML defining an object property
Alexander Dyagilev
alervdvcw at gmail.com
Wed Jun 2 11:43:49 CEST 2021
Thanks.
On 6/1/2021 10:52 AM, Pierre-Yves Siret wrote:
>
>
> Le lun. 31 mai 2021 à 19:59, Alexander Dyagilev <alervdvcw at gmail.com
> <mailto:alervdvcw at gmail.com>> a écrit :
>
> Hello,
>
> Am I right that this is not possible in QML?
>
> readonlypropertyvarmainTbImg:{
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210602/3a93dbfb/attachment.html>
More information about the Interest
mailing list