Skip to content Skip to sidebar Skip to footer

Qml Listmodel Append Broken For Object Containing An Array?

ListModel produces unexpected and pretty much broken results when trying to insert a JS object which contains an array: property ListModel model : ListModel {} Component.onComplet

Solution 1:

From the ListModel docs:

The ListModel is a simple container of ListElement definitions [...]

If you then go to the documentation of ListElement:

Values must be simple constants; either strings (quoted and optionally within a call to QT_TR_NOOP), boolean values (true, false), numbers, or enumeration values (such as AlignText.AlignHCenter).

Post a Comment for "Qml Listmodel Append Broken For Object Containing An Array?"