[Interest] QML: Class to map from role-based column fetching to (x, y)-based column fetching?

Johannes Schaub schaub.johannes at googlemail.com
Sun Oct 12 23:15:01 CEST 2014


I want to ask whether there is a proxy model that makes it easier to use a 
QAbstractTableModel derived class with QML to display all columns of a given 
existing C++ item model, instead of just column 0.

I have seen a couple of suggestions that involve overriding `data` on the 
proxy model that translates to the column associated with a particular role. 
This of course does not suffice, as it doesn't handle all the 
`XXXAboutToBeInserted`, `XXXAboutToBeRemoved` signals and friends of the 
source model. Such signals should be translated back to `dataChanged` and 
generation of new role strings to be completely generic. 

My question is, whether there already is a generic solution, or whether such 
is planned for Qt in a future version? 

(There is a SO question on this too, see 
https://stackoverflow.com/questions/26329165/using-an-existing-row-column-c-model-with-qtquick-grid-tableview).





More information about the Interest mailing list