[Qt-interest] setRootPath() on QFileSystemModel not working
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Tue Jun 29 10:05:57 CEST 2010
I have some very simple code to show dir listings in a tree view:
<snip>
...
QFileSystemModel model;
QTreeView view;
model.setRootPath("/home/mandeep/test/");
view.setModel(&model);
view.show();
...
</snip>
When I run this, the tree view is showing me dir's from my systems
root dir, i.e "/" and not "/home/mandeep/test/" as I'd set it.
Calling model.rootPath() shows the root path to what I'd set.
Is there something I'm missing? Why does it show files from the root
nad not from where I specify?
I'm using Ubuntu 10.04.
This seemed to be trivial task and now I'm stuck! :)
Thanks,
-mandeep
More information about the Qt-interest-old
mailing list