[Qt-interest] How to use a QSortFilterProxyModel to view more than one model in a view?

NoRulez norulez at me.com
Wed Oct 6 08:09:25 CEST 2010


I want to have two pseudo items in a treeview, eg. Tree1 and Tree2

When I click on a child of the Tree1 item then I want to get data from the QStandardItemModel.

If I click on a child item of tree2, then I want to get data from the QDirModel

Am 06.10.2010 um 07:27 schrieb Andre Somers <andre at familiesomers.nl>:

>  Op 5-10-2010 21:01, norulez schreef:
>> Hi,
>> 
>> can anybody explain me on how to use a QSortFilterProxyModel to view more than one model in a view?
>> 
>> For example, I want to display a QStandardItemModel and a QDirModel, both in a QTreeView.
>> 
>> Much thanks in advance
> QSortFilterProxyModel can't do that.
> There is no standard proxy model that can merge existing models. That 
> would not make much sense either, as only you know how you want those 
> two models to merge. You know how they relate and how you can sensibly 
> put them in a single view, but no standard model does, and neither do we.
> 
> Perhaps you should explain what you want to achieve first, instead of 
> the way you think you should reach that goal.
> 
> André
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list