tags:

views:

50

answers:

1

i would like to have a multiple directory view

while using QDirModel and qtreeview like this :

 QDirModel *model = new QDirModel;
 QTreeView *tree = new QTreeView();
 tree->setModel(model);

i can view the content of a given root directory how can i view multiple roots directory on a single widget like QTreeView

+1  A: 

You could probably do this by making a proxy model. You'd want to add multiple QDirModel instances with different roots to the proxy model, and interpret the mapToSource and mapFromSource items appropriately. The top level of items in your tree would need to be supplied by the proxy model itself, which might make things a little tricky.

Caleb Huitt - cjhuitt