Hi Harri,

On 11.07.2012 11:02, Harri Pasanen wrote:
> How do I access list model data properties without a delegate?

I had the same problem. To the class MyModel that inherits from 
QAbstractListModel I added a property

Q_PROPERTY(QDeclarativeListProperty<MyItem> myItems READ myItems NOTIFY 
myItemsChanged)

with according methods, and then I also could access the items in the 
model (let's say with id "my_model") in QML with my_model.myItems[n]. I 
also would prefer if I could use the [] operator directly on the 
my_model (that is my_model[n]), but I couldn't find out how yet. 
Multiple inheritance? Maybe someone on this list has an idea?


Best regards

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

Reply via email to