Ok I found the problem. I had to declare my property with the full namespace.
By the way, Qt, and more specifically QtCreator, have some issues dealing with 
namespaces and aliased namespaces.

Olivier.




>________________________________
> De : BOUCARD Olivier <boucard_oliv...@yahoo.fr>
>À : Qt Interest List <interest@qt-project.org> 
>Envoyé le : Vendredi 6 avril 2012 13h44
>Objet : [Interest] Using QQmlListProperty and QAbstractListModel
> 
>
>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
>
>
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to