Re: [Qt-qml] Accessing a QAbstractItemModel in QML outside a view

2010-12-01 Thread Jan Ekholm
Martin, thanks for the hint! Ok, I guess that would work. Not exactly straightforward though. I assume it will also work when I need to iterate over all items in a model to do some operation on all of them, but by indexing using something. Hm, I looked at the API and it seems I can't access

[Qt-qml] Accessing a QAbstractItemModel in QML outside a view

2010-11-30 Thread Jan Ekholm
Hi, The subject says it all, apart from the context. Accessing a QAIM in a view (such as a ListView) is all nicely documented and works as expected. However, how can I access the same exposed C++ model outside a view? In my case I want to show a list of data and next to the list have some

Re: [Qt-qml] Accessing a QAbstractItemModel in QML outside a view

2010-11-30 Thread martin.jones
Right now if you want to access data in your model in script, you will need to add methods to your model to allow that. For the specific case of showing data from the currentItem, you can expose the model data, e.g. ListView { Id: list delegate: Text { property variant data: