class FileSystemModel(QtGui.QFileSystemModel):

    def __init__(self, *args, **kwargs):
        super(FileSystemModel, self).__init__(*args, **kwargs)
self.condition = None

def setCondition(self, condition):
    self.condition = condition
self.dataChanged.emit(QtCore.QModelIndex(), QtCore.QModelIndex())

def data(self, index, role=QtCore.Qt.DisplayRole):
    pass
Conditionally change color of files in QListView connected to QFileSystemModel