[Development] QML and QAbstractListModel

Alberto Mardegan mardy at users.sourceforge.net
Mon Jan 14 11:07:36 CET 2013


On 01/14/2013 09:29 AM, André Somers wrote:
> I am not fan of this change. I think the API of QAIM is already very
> complex. Adding more methods that basically only sort-of mirror existing
> methods but for a more confined use-cases only makes that situation
> worse. For instance, you now get a count() method that claims that it
> returns the number of items in the model. What does that mean in the
> context of a tree model?

I added the property (and the new get() method) to QAbstractListModel, 
not to QAbstractItemModel.

[...]
> Perhaps an alternative approach would be to create a proxy model for
> exporting to QML. It could include all the methods you need, but it
> would not complicate QAIM itself.
[...]

That might be the best approach, yes. But I wonder if we should target 
tree models or just list models. The API for tree models might be 
significantly more complex (exporting QModelIndex to QML might not be 
trivial).

Ciao,
   Alberto



More information about the Development mailing list