[PySide] sanity checking my QFileSystemModel approach

Frank Rueter | OHUfx frank at ohufx.com
Thu Apr 6 02:25:22 CEST 2017


Hi all,

I need to write a simple app that shows two file trees:
on the left the one on disk in a given root directory, and on the right 
the same tree how it will look after certain processing will take place 
(as a pre-flight check).
E.g. I have a source directory like this:

source
     |___.Trashes
     |___A
             |___file1.tiff
             |___file2.tiff
             |___file3.tiff
             |___file4.tiff
     |___B
             |___file1.jpg
             |___file2.jpg
             |___file3.jpg

I now want to copy this tree to a different location following certain 
rules and want a preview before I actually do anything to the files.
The rules in this case could be:

  * ignore all .Trashes folders
  * zip all tiff files in the same directory.


So as a second tree view for the preview I'd like to have a view that 
would looks like this:
source
     |___A
             |___file.zip
     |___B
             |___file1.jpg
             |___file2.jpg
             |___file3.jpg

In the original file tree I'd like to colour code the items that will be 
modified as seen in the second tree view.

My question now is:
Can I harness QFileSystemModel for this or do I need to write my own 
tree model to get the functionality I need?

I assume I can use QFileSystemModel for the source tree, but not for the 
preview tree?
Is that correct?
Any other thoughts on this approach before I back myself into a corner :-D

Cheers,
frank


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20170406/709e8400/attachment.html>


More information about the PySide mailing list