[QBS] dictionary in qbs

Bornemann Joerg Joerg.Bornemann at theqtcompany.com
Wed Jan 7 16:09:41 CET 2015


> I'd like to declare an object in my qbs file that is a collection of key-value pairs, i.e., a dictionary.
> The documentation here: http://doc.qt.io/qbs/cpp-module.html states that this can be done for the infoPlist property of the cpp module as well.
> I have tried several formats, e.g.:
>
> property var tst: { "key": 4, }
>
> and so on, but all I get is syntax errors. How do I declare a dictionary properly?

The syntax to pass object literals to properties is:
    property var tst: ({ "key": 4, })

That's an idiosyncrasy of the QML parser.


BR,

Joerg


More information about the Qbs mailing list