Results 1 to 5 of 5

Thread: QFileSystemModel::setFilter issue!!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QFileSystemModel::setFilter issue!!

    Hi all:

    I am trying to construct a custom file manager, using QListview, QTreeview, and two QFileSystemModel!!

    The QListview is set with the QFileSystemModel( Listmodel ) which is setFilter like the code below:
    Qt Code:
    1. setFilter( QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks );
    To copy to clipboard, switch view to plain text mode 

    The QTreeview is set with the QFilesystemModel which is setFilter like the code below:
    Qt Code:
    1. setFilter( QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks );
    To copy to clipboard, switch view to plain text mode 

    When the file manager shows up at the beginning, everything looks perfect as the first attach file.

    But after few steps, the filter in the Listmodel seems to become invalid as the second attach file.
    1. Double click a folder called "test", which includes a subfolder, in the treeview. And the subfolder icon shows up.
    2. Choose a subfolder of the folder "test", then the listview shows the files in the subfolder
    3. Choose back to the folder "test", and the listview shows all files in the folder including the subfolder.

    The result is not correct with the filter being set to the Listmodel!!!

    Could anyone tell me what's wrong?!?!?
    Thanks in advanced.

    Kenny

Similar Threads

  1. Using bindValue with QSqlTableModel.setFilter()
    By manuels in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2010, 13:16
  2. QSqlTablemodel->setFilter()
    By codeman in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2009, 15:52
  3. trouble with QSqlRelationalTableModel and setFilter
    By yleesun in forum Qt Programming
    Replies: 5
    Last Post: 3rd March 2009, 07:02
  4. QDataTable setFilter
    By cristiano in forum Qt Programming
    Replies: 10
    Last Post: 17th November 2006, 01:38
  5. Replies: 6
    Last Post: 4th April 2006, 07:13

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.