[Qt-qml] QML model handling
michael.brasser at nokia.com
michael.brasser at nokia.com
Fri Oct 22 07:19:27 CEST 2010
On 13/10/2010, at 11:45 PM, ext Charley Bay wrote:
> michael spaketh:
>> One of the things we're researching now that 4.7 is out the
>> door is how we work with data sets in QML. Part of that is
>> researching "next generation" model classes for QML
>
> Outstanding. I *love* your list. In particular, I vote for:
>
> (1) Allowing easy creation of custom models
> (2) Allowing rows to have type information (or any user type
> information added to the model).
>
> I'm a long-time model user. IMHO, the model/view infrastructure is
> *very* well designed -- that's hard to do, so congrats (people have
> been attempting general purpose designs in that domain for decades).
>
> However, IMHO, the *one* Achilles Heel that I've found relates to
> QModelIndex: It's a transient on-the-stack type (that's good), but has
> no type information, so a model with heterogeneous types requires users
> to create "wrappers" that must be managed in a cached hierarchy
> that mirrors the "real" model (very expensive). IMHO, this issue
> will be exasperated in migrating to QML, which IMHO is superior
> as an interface paradigm, as it increases the chasm between the
> business logic and the GUI (that's GOOD).
>
> My "wish" is that (1) QModelIndex have some context for user type
> information, OR (2) QModelIndex provide a mechanism for the user
> to create a "wrapper" that is "owned" by the QModelIndex (so the
> QModelIndex will delete that wrapper when the index is destructed).
>
> There's a thread on this topic from 2006, and we've never really
> resolved our problems:
>
> <http://lists.trolltech.com/qt-interest/2006-11/thread00266-0.html>
Thanks for the feedback. I found the above thread to be an interesting read -- we'll certainly be looking to provide some sort of support for heterogeneous model items, though I'm not sure what that will look like yet.
Regards,
Michael
More information about the Qt-qml
mailing list