[Qt-interest] QFileSystemModel and QTreeView interesting problem

Andrei Cimpean andreiamenta at gmail.com
Fri Mar 26 17:24:59 CET 2010


Hello everybody.

I am trying to display folders in a tree with this code:
    treeModel = new QFileSystemModel;
    m_ui->treeView->setModel(treeModel);
    treeModel->setRootPath(QDir::homePath());//this displays /Users/andrei
    treeModel->setFilter(QDir::AllDirs |QDir::AllEntries|QDir::System|QDir::Hidden|QDir::NoDotAndDotDot);
    treeModel->setReadOnly(true);

, but the result is:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2010-03-26 at 6.23.04 PM.png
Type: image/png
Size: 8232 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100326/0ea9f783/attachment.png 
-------------- next part --------------

.

Any ideas ?
Thanks in advance.


More information about the Qt-interest-old mailing list