One way to fix this is to reimplement the model's data() method so that the value for the TextAlignmentRole always includes the AlignVCenter flag:
# python3 or sip.setapi('QVariant', 2)
class FileSystemModel(QtGui.QFileSystemModel):
def data(self, index, role):
value = super(FileSystemModel, self).data(index, role)
if role == QtCore.Qt.TextAlignmentRole and value is not None:
value |= QtCore.Qt.AlignVCenter
return value
# python2 or sip.setapi('QVariant', 1)
class FileSystemModel(QtGui.QFileSystemModel):
def data(self, index, role):
value = super(FileSystemModel, self).data(index, role)
if role == QtCore.Qt.TextAlignmentRole and value.isValid():
value = value.toInt()[0] | QtCore.Qt.AlignVCenter
return value