aurora
3rd May 2012, 10:21
Hi ,
I using filesystem model in my program to display the filesystems....
Its working fine, it displays all the files and directoris including Dot and DotDot....
But i dont want to display the "DotDot" hence i used filter as shown below, unfortunately its not working....IT DISPLAYS DOTDOT ALSO....
Please somebody tell me whats wrong here...
QString sPath=ui->lineEdit_directory->text();
dirmodel =new QFileSystemModel(this);
dirmodel->setFilter(QDir::AllDirs | QDir::Dirs |QDir::NoDotDot); <---HERE "QDir::NoDotDot" IS NOT WORKING
dirmodel->setRootPath(sPath);
ui->treeView->setModel(dirmodel);
ui->treeView->setRootIndex(dirmodel->index(sPath));
I using filesystem model in my program to display the filesystems....
Its working fine, it displays all the files and directoris including Dot and DotDot....
But i dont want to display the "DotDot" hence i used filter as shown below, unfortunately its not working....IT DISPLAYS DOTDOT ALSO....
Please somebody tell me whats wrong here...
QString sPath=ui->lineEdit_directory->text();
dirmodel =new QFileSystemModel(this);
dirmodel->setFilter(QDir::AllDirs | QDir::Dirs |QDir::NoDotDot); <---HERE "QDir::NoDotDot" IS NOT WORKING
dirmodel->setRootPath(sPath);
ui->treeView->setModel(dirmodel);
ui->treeView->setRootIndex(dirmodel->index(sPath));