开发者

multiple directory view

开发者 https://www.devze.com 2023-01-16 01:56 出处:网络
i would like to have a multiple directory view while using QDirModel and qtreeview like this : QDirModel *model = new开发者_如何学Python QDirModel;

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

精彩评论

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