[Qt-interest] How to just show tree model _leaf nodes_ in a table view?

Andre Somers andre at familiesomers.nl
Mon Apr 4 13:18:48 CEST 2011


Op 4-4-2011 13:05, Patricia Santana Cruz schreef:
>
> You said you found some code examples that could help and that I would
> have to make some changes in my table proxy model, but I did not find
> those examples and do not understand how can I make this happen. Could
> you be a little bit more explicit please?. Or paste the link with the
> example you saw?
I gave you the exact words I googled on. On page 1, it gives me a 
"FlatProxyModel" class written by Bo Thorsten and it gives me a 
reference from Steveire's blog to a KDescendantProxyModel (I image you 
could google these directly too...) Both would work as starting points 
to what you are after, though they are no complete, drop-in solutions.

As the the selection issue: you would create some kind of setRoot slot 
in your proxy model, and use that to determine from which node in the 
tree the search for the leaf nodes would start.

André




More information about the Qt-interest-old mailing list