aurora
13th February 2012, 05:40
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....
QString sPath ="C:/Users/dmck/Desktop/folder1";
dirmodel =new QFileSystemModel(this);
dirmodel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs);
dirmodel->setRootPath(sPath);
ui->treeView->setModel(dirmodel);
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....
QString sPath ="C:/Users/dmck/Desktop/folder1";
dirmodel =new QFileSystemModel(this);
dirmodel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs);
dirmodel->setRootPath(sPath);
ui->treeView->setModel(dirmodel);