In my program i'm using tree view with a QFileSystemModel...
But i'm unable to set a default root path in that.....
i want to display a particular directory to display, whn program executes.....But it is showing c:\, d:\ and e:\ always...
what should i do?


code i tried.....But its not taking that path as default....

Qt Code:
  1. QString sPath ="C:/Users/dmck/Desktop/folder1";
  2.  
  3. dirmodel =new QFileSystemModel(this);
  4. dirmodel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs);
  5. dirmodel->setRootPath(sPath);
  6. ui->treeView->setModel(dirmodel);
To copy to clipboard, switch view to plain text mode