PDA

View Full Version : QListView and QDirModel



BTe
4th February 2008, 17:00
Hi,

I try to use a QDirModel and a QListView to display bitmap Images in directories.

After defining my QDirModel, I defined my QListView to display images like this :

listView->setModel(model);
listView->setRootIndex(model->index("C:\\"));

But when I tried to do the same thing to change my directory

listView->setRootIndex(model->index("C:\\OtherDirectory"));
onto a function, it doesn't work.

Anything wrong ?

thanks
Bruno:confused:

jpn
4th February 2008, 17:36
Hmm, it should "work" provided that it's a valid path. Have you noticed Extended Dir View example?