Results 1 to 3 of 3

Thread: How to display folders and files in listView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default How to display folders and files in listView

    How to display folders and files in listView but also, how to include dot and dot dot paths. I can simply display files and folders using QFileSystemModel, but dot dot is not being displayed.
    Thanks for any hjalp.

  2. #2
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to display folders and files in listView

    have a look at Fetch more example in Qt examples, I remember i could see . & .. in that example.
    Thanks :-)

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to display folders and files in listView

    The QFileSystemModel is usually intended to be used with a tree view, so it doesn't need the dot and dotdot entries for navigation.
    You could try resetting the filter (setFilter) so that these two are part of the allowed set.

    If that does not work, I would suggest a simple custom list model that uses QDir::entryList/entryInfoList internally.

    Cheers,
    _

Similar Threads

  1. how to display files of a directory in a listview
    By sliverTwist in forum Newbie
    Replies: 2
    Last Post: 2nd April 2013, 06:29
  2. Replies: 8
    Last Post: 15th May 2012, 06:21
  3. Qt select folders and files dialog.
    By bunjee in forum Qt Programming
    Replies: 5
    Last Post: 13th July 2009, 09:53
  4. viewing files or some folders
    By as001622 in forum Qt Programming
    Replies: 4
    Last Post: 2nd June 2008, 13:12
  5. How to manage files with different folders for make
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2007, 14:44

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.