Need some help and direction in understanding QSortFilterProxyModel. I am 
creating a tool in Maya using PySide2 (Qt.py).

*GOAL:*
I have already built a filebrowser QTreeView with a QFileSystemModel. 
Folders and files are both displayed.
I have a filter for files with a certain extension on the source model. 
(Maybe move this filter to proxy model..)

The files are in this format:

name.0001.ext
name.0002.ext
name.0003.ext


What I want to do is, show the versions of a file in a treeView like this:

- name (not an actual folder, virtual row I want to insert)
--name.0001.ext
--name.0002.ext
--name.0003.ext


So the intention is that QTreeView will always display the files with the 
names w/o versions. The user has to expand the name to see the version 
files.
Further on I will implement something that imports the latest file when the 
"name" is operated on.

*HELP:*
I believe I can subclass QSortFilterProxyModel to do this. Is this right?
Can someone enlighten me on how to go about it?

Another options is to subclass QAbstractItemModel. I have yet to look deep 
into this.
I would prefer QSortFilterProxyModel (based on what I have read). But 
suggestions are welcome.

I will attach some code if required. I will have to extract it from my tool 
code. 
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/df3e4b4a-69e1-432e-9fd9-0164463d8d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to