Results 1 to 5 of 5

Thread: QFileSystemModel/QListView and Additional file description

  1. #1
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFileSystemModel/QListView and Additional file description

    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

  2. #2
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFileSystemModel/QListView and Additional file description

    Quote Originally Posted by Rysiek View Post
    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.

  3. #3
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileSystemModel/QListView and Additional file description

    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.

  4. #4
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFileSystemModel/QListView and Additional file description

    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. It might give you some ideas on how to do what you are after.

  5. #5
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileSystemModel/QListView and Additional file description

    You are referring to making my own model on a base of the QFileSystemModel, and reimplementing itemData parameter? I'll try it, thanks.

Similar Threads

  1. Selecting file in QFileSystemModel tree view
    By Cougar in forum Qt Programming
    Replies: 3
    Last Post: 28th August 2011, 02:52
  2. Replies: 0
    Last Post: 23rd February 2011, 15:24
  3. Replies: 0
    Last Post: 20th July 2010, 15:55
  4. how use QFileSystemModel with QListView ?
    By lwifi in forum Qt Programming
    Replies: 4
    Last Post: 26th April 2010, 04:41
  5. QFileSystemModel file icon overlays
    By squidge in forum Qt Programming
    Replies: 2
    Last Post: 18th October 2009, 12:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.