PDA

View Full Version : QFileSystemModel/QListView and Additional file description



Rysiek
20th April 2011, 07:53
Hi All,

I writing simple image viewer and have have question. I using now QListWidget to show thumbnails and file descriptions, but I would like to switch to QListView + QFileSystemModel. It looks, like it works fine, except file names/description. I would like to have, instead of simple file names, some customized text (image description etc.), and I can't find way to put it in QFileSystemModel (there is no setText() method like in QListWidgetItem, I can't find any similar way). Is there any way to to this?

Regards
Ryszard

agarny
20th April 2011, 09:47
I writing simple image viewer and have have question. I using now QListWidget to show thumbnails and file descriptions, but I would like to switch to QListView + QFileSystemModel. It looks, like it works fine, except file names/description. I would like to have, instead of simple file names, some customized text (image description etc.), and I can't find way to put it in QFileSystemModel (there is no setText() method like in QListWidgetItem, I can't find any similar way). Is there any way to to this?I am not sure whether I understand your requirements correctly, but it's not your QFileSystemModel object that you need to 'customize'. It's your view (using QListView) which must render your QFileSystemModel object the way you want it.

Rysiek
20th April 2011, 10:32
Yes, perhaps you right, but I did not found the way to change the way that QListView is rendering QFileSystemModel. As I mentioned, in QListWidget, there is QListWidgetItem, ant it provide me easy way to change everything I want, unfortunately it does not work witch QFileSystemModel, and QListView does not provide anything similar to QlistWidgetItem.

agarny
20th April 2011, 10:53
Well, tell yourself that you are, at least, doing the right thing by going away from QlistWidgetItem and by using QListView with QFileSystemModel. Otherwise, you might want to check qtfm (http://www.qtfm.org/). It might give you some ideas on how to do what you are after.

Rysiek
20th April 2011, 12:15
You are referring to making my own model on a base of the QFileSystemModel, and reimplementing itemData parameter? I'll try it, thanks.