[Interest] Make a flat Model from a hierarchical Model with all children

Bo Thorsen bo at fioniasoftware.dk
Wed Mar 28 08:20:00 CEST 2012


Den 27-03-2012 14:01, André Somers skrev:
> Op 26-3-2012 18:34, j-p.nurmi at nokia.com schreef:
>>> I have a hierarchical Model and i want to have a flat Model.
>>>
>>> Does anyone have an idea on how to do this with an proxy model?
>>>
>> Try this:http://www.fioniasoftware.dk/blog/?p=51
>>
> Interesting. Not sure why he (Bo) didn't just replace the view with a
> QTreeView though? Seems simpler...

Hehe, you're missing the next level - the view classes are not the only 
ones that can use the models :) I use this to choose items in a tree 
model with a combo box.

QComboBox can take a model to deliver the items in it. But tree models 
have parents and usually multiple columns. The flat proxy can make a 
single item with the text of each item based on several columns.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Interest mailing list