class FileSystemModel(QtGui.QFileSystemModel):

    def __init__(self, *args, **kwargs):
        super(FileSystemModel, self).__init__(*args, **kwargs)
self.condition = None
Conditionally change color of files in QListView connected to QFileSystemModel