Results 1 to 2 of 2

Thread: Filter QListView/QTreeView using QFileSystemModel

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Filter QListView/QTreeView using QFileSystemModel

    Hi,
    I use a QFileSystemModel on QListView and QTreeView, all works fine but I added a searchbox and there comes problems.
    I tried to inherit QSortFilterProxyModel to filter the list/tree based on my searchbox but I got only problems.
    When I set the inherited QSortFilterProxyModel class, the list doesn't show the path I set but the drives.
    How make correctly a search filter on this case ?
    Thanks

  2. #2
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Filter QListView/QTreeView using QFileSystemModel

    Ok I solved the first problem, when you use a proxy you have to map index from proxy and to proxy.
    The problem is then I tried to connect a line edit to the proxy filter function but I didn't had good behavior using QSortFilterProxyModel.
    The good behavior on my case is to find if the row contains a text using case insensitive and hide all other, show all parent if it's a child.
    Is it needed to use a custom proxy for this case ?
    Thanks

Similar Threads

  1. Replies: 2
    Last Post: 22nd January 2015, 14:58
  2. Replies: 0
    Last Post: 20th November 2012, 10:05
  3. Weird behavior when filter QFileSystemModel by proxy
    By stereoMatching in forum Newbie
    Replies: 0
    Last Post: 27th July 2012, 09:25
  4. Replies: 4
    Last Post: 20th April 2011, 12:15
  5. how use QFileSystemModel with QListView ?
    By lwifi in forum Qt Programming
    Replies: 4
    Last Post: 26th April 2010, 03:41

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.