PDA

View Full Version : something abourt the QDirModel



xiongxiongchuan
11th June 2010, 12:35
i used below code to create a widget inheriting form QTreeView,and used the QDIrModel to show the dir
but i did't want to have some folders to have the function to back the parent folder,

projectModel=new QDirModel;
projectModel->setFilter(QDir::Files|QDir::Dirs);
projectModel->setResolveSymlinks(true);
this->setModel(projectModel);
this->setRootIndex(projectModel->index(projectAddressString,0));



and it looks like this

4782

numbat
11th June 2010, 12:53
Try using QDir::NoDotAndDotDot.