Op 28-3-2012 8:20, Bo Thorsen schreef: > Den 27-03-2012 14:01, André Somers skrev: >> Op 26-3-2012 18:34, j-p.nu...@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. No, I got that part. My point was (or was supposed to be) that QComboBox can also display a tree directly, if you use it's setView method and set a tree view there. For easy use, you'd only need to confine the tree to a single column, but the parent/child relationship does not need to be removed for that.
André _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest