[Qt-interest] Help Tree view with Dir Model
yogesh upreti
yogesh.upreti at gmail.com
Fri May 14 17:51:33 CEST 2010
Hi Denis,
QFileSystemModel is working in background and loading step by step in
parallel, this is a little bit undesirable.
I read this mail before and the document too but I still can't find how to
specify which should be the selected index??
Thanks anyway for help
Hi,
Qt Doc recommends use QFileSystemModel instead of QDirModel. The similar
topic discussed in this list:
http://lists.trolltech.com/pipermail/qt-interest/2010-March/021062.html
and
http://lists.trolltech.com/pipermail/qt-interest/2010-March/021195.html
Hope it helps.
2010/5/14 yogesh upreti <yogesh.upreti at gmail.com>
> Hello Everyone,
> I am using a tree view in my application to show the dir-structure. I am
> using the example given in Qt application:
>
> QDirModel dirModel;
> dirModel.setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
> ui->tempDirView->setModel(&dirModel);
> (tempDirView is a QTreeView object)
>
> now I want to expand this tree to the current dirctory, for that, I am
> using :
>
> QString pathFileView = QDir::currentPath(); (I am getting desired value
> here)
> QModelIndex ind = this->dirModel.index(pathFileView);
> ui->tempDirView->setExpanded(ind, true);
>
> But this is not doing anything. Also I try to print ind.row() but this
> gives me 0
>
> Do you think this is a correct way to do that or there is a better/correct
> way for this?
>
> Thanks
> Yogesh
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
--
Best regards,
Denis Akhmetzyanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.trolltech.com/pipermail/qt-interest/attachments/20100514/b71f8af6/attachment.html
------------------------------
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
End of Qt-interest Digest, Vol 18, Issue 133
********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100514/c4053dd6/attachment.html
More information about the Qt-interest-old
mailing list