Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to make QTreeView/QListView display specific folders?
Forum Updated to NodeBB v4.3 + New Features

How to make QTreeView/QListView display specific folders?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 466 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JackkkkkJ Offline
    JackkkkkJ Offline
    Jackkkkk
    wrote on last edited by
    #1

    i want to make a custom file manager that just shows specific folders.
    like this screenshot: only normal folders are displayed in the treeView, and only special folders ending with .asset (or ANY folder with a specific name such as beginning with an underscore "_folder9") are diaplayed in the listView.
    alt text

    filtering in QTreeView/QListView? or filtering in QFileSystemModel? QSortFilterProxyModel? even customize a QAbstractItemModel? which is the best solution? AT LEAST, it works!

    ** this is my question on the Qt for Python channel. i think if the C++ solution works, then Python will work too.
    https://forum.qt.io/topic/106568/how-to-customize-qsortfilterproxymodel-to-display-specific-folders

    VRoninV 1 Reply Last reply
    0
    • JackkkkkJ Jackkkkk

      i want to make a custom file manager that just shows specific folders.
      like this screenshot: only normal folders are displayed in the treeView, and only special folders ending with .asset (or ANY folder with a specific name such as beginning with an underscore "_folder9") are diaplayed in the listView.
      alt text

      filtering in QTreeView/QListView? or filtering in QFileSystemModel? QSortFilterProxyModel? even customize a QAbstractItemModel? which is the best solution? AT LEAST, it works!

      ** this is my question on the Qt for Python channel. i think if the C++ solution works, then Python will work too.
      https://forum.qt.io/topic/106568/how-to-customize-qsortfilterproxymodel-to-display-specific-folders

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @jackkkkk said in How to make QTreeView/QListView display specific folders?:

      QSortFilterProxyModel

      100% the way to go here

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      JackkkkkJ 1 Reply Last reply
      4
      • VRoninV VRonin

        @jackkkkk said in How to make QTreeView/QListView display specific folders?:

        QSortFilterProxyModel

        100% the way to go here

        JackkkkkJ Offline
        JackkkkkJ Offline
        Jackkkkk
        wrote on last edited by
        #3

        @vronin QSortFilterProxyModel is my current choice, but i get very strange results. could you spare some time to look at my original post, which has more details. https://forum.qt.io/topic/106568/how-to-customize-qsortfilterproxymodel-to-display-specific-folders

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved