Array of struct to ListView model
-
[quote author="t3685" date="1414696300"]You can only expose qobject and certain basic types to qml. You need to wrap your struct in a qobject class.
For arrays you need to use either a model such as qabstractlistmodel or qqmllistproperty[/quote]
Only this? Are there any simpler way? -
As far as I know yes. The abstract list model is easiest and easy in general in my opinion. You only need to reimplement four or so virtual functions, which is quite straightforward and internally you can your array of struts.
Doesn't get much easier than that