Hi all,

I'm trying to use QQmlListProperty with Qt5.
I''ve followed the QtDeclarative Extending Chapter 5 tutorial, with PieChart 
and PieSlice, which works.
I want to fill a custom model from QML with specific items. Maybe there is 
another way but I didn't found it.

 
I have a class MyModelItem which extends QObject with some properties.
I have a class MyModel which extends QAbstractListModel with a 
QQmlListProperty<MyModelItem> property with the proper callbacks.

When I try to fill my model from QML with something like this:

MyModel {
items: [
MyModelItem {
name: "item 1"

},
MyModelItem {
name: "item 2" 
}
]

}

I have the following error: "Cannot assign multiple values to a singular 
property".

What am I doing wrong?

Thank you.

Olivier.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to