Results 1 to 6 of 6

Thread: QFileSystemModel hiding folders

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QFileSystemModel hiding folders

    How can I prevent folders from being show in a QFileSystemModel ?

  2. #2
    Join Date
    Oct 2008
    Posts
    71
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QFileSystemModel hiding folders

    you should probably change the filters with QFileSystemModel::setFilter

  3. #3
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QFileSystemModel hiding folders

    You mean QFileSystemModel::setNameFilters. "Sets the name filters to apply against the existing files." Not what I need, I want to prevent folders from being displayed.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QFileSystemModel hiding folders

    Quote Originally Posted by been_1990 View Post
    You mean QFileSystemModel::setNameFilters.
    No, he doesn't, He meant QFileSystemModel::setFilter(). Have a look at the possibilities QDir::Filter gives you.

  5. #5
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QFileSystemModel hiding folders

    No, he doesn't, He meant QFileSystemModel::setFilter(). Have a look at the possibilities QDir::Filter gives you.
    Yeah, my bad. I wrote that because I searched the QtCreator docs for setfilter instead of setFilter, couldn't imagine it would make a difference. Where is Google Search when we need it...
    But thanks, it solved my problem.

  6. #6
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QFileSystemModel hiding folders

    But with the QDir::Filters u can only specify global filters, not specific ones.
    If i wanna prevent a folder with name Movies to appear in the FileSystemModel.
    How can i do ti ?

    thanks

Similar Threads

  1. QFileSystemModel with checkboxes...
    By been_1990 in forum Qt Programming
    Replies: 14
    Last Post: 11th March 2011, 15:01
  2. Help with QFileSystemModel
    By TheShow in forum Qt Programming
    Replies: 4
    Last Post: 5th January 2010, 20:11
  3. Notifying QFileSystemModel about changes
    By squidge in forum Qt Programming
    Replies: 3
    Last Post: 23rd November 2009, 23:24
  4. QDirModel or QFileSystemModel?
    By ricardo in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2009, 17:10
  5. QFileSystemModel has no sorting
    By mpi in forum Qt Programming
    Replies: 3
    Last Post: 28th May 2009, 08:14

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.