开发者

multiple directory view

i would like to have a multiple directory view

while using QDirModel and qtreeview like this :

 QDirModel *model = new开发者_如何学Python 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜