[Qt5-feedback] Item Views Next Gen

Stephen Kelly steveire at gmail.com
Sat May 21 07:04:41 CEST 2011


Hi Jens,

Jens Bache-WIig wrote:
> With respect to models. My main goal was to make it work natively with
> the built in QML models. This means ListModel, XMListModel etc. These
> models are one-dimentional in nature and simply provide a set of basic
> properties per model index. As you mentioned, my proposed solution is
> based on providing one model property to feed each item per row. You
> should be able to work around this limitation by making the column
> property itself a property-value map. 

Ok. For dynamic data, ListModel doesn't really cut it for those of us who 
need C++ and QML intergation, so I'll be interested in what happens with 
other models and features later. I would like to see research which doesn't 
start with a ListView element at its core personally, because I think things 
like tables and trees require deeper thought than 'Lets start with what QML 
has and implement everything we need in javascript'. From my experience with 
QML that can get awkward.

> As for other C++ models, you may
> need to write a proxymodel so that the property names are exposed to QML
> in the same way. (For instance the QMLViewer does this to expose a
> QDirModel to it's internal directory browser)

I'm either looking in the wrong place, or the QDirModel and proxy have been 
removed. I'd like to see why the proxy is needed at all. Can you point me to 
this?

> 
> My main concern right now is to get improved performance out of
> ListView. TreeView is not something I have looked into yet and I am not
> sure how to structure the models to support it. My main goal was not to
> implement everything Qt Item View does but to support the most common
> use cases for the desktop.

I'll be interested in seeing how you make a tree work. I'll keep an eye out.

> 
> As for multiple selection, I know we will have to support it, but I
> simply haven't gotten around to investigate it yet. It might require
> some improvements in the ListView itself but it is on our to-do list for
> sure. What you see in the repository is what we have right now.
> 
> If you want to contribute or suggest other improvements, they are
> certainly welcome.

Yep. I don't have any bandwidth at this time to do that kind of thing. I do 
suggest that you make the model of a selection be a separate class like 
QItemSelectionModel is so that interaction with the views in QML can be 
interacted with from C++. That is definitely needed even for single 
selection. I think I eventually mananged to convince aalpert of that last 
year, but didn't push any more on it since.

Regards,

Steve.





More information about the Qt5-feedback mailing list