<div><span style="line-height: 1.5;">when the contents of the QFileSystemModel is displayed in a QTableView , the alignment of the text in the first row header section is right-aligned ,while the others is </span><span style="line-height: 1.5;">left-aligned,I wonder why ?</span></div><div><img src="cid:2E49FB4A@FD261F29.D32B8652.jpg" filesize="16473"></div><div>how to make the alignment of the text in each header section to be left-aligned?</div><div><br></div><div>setDefaultSectionSize() seems doesn't work here</div><div><br></div><div>my code </div><div><br></div><div><div>import sys   </div><div>from PyQt4.QtGui import *</div><div>from PyQt4.QtCore import *</div><div><br></div><div>if __name__ == '__main__':   </div><div><br></div><div>    app =QApplication(sys.argv)      </div><div>    ui =QMainWindow()   </div><div><br></div><div>    model= QFileSystemModel ()      </div><div>    model.setRootPath(QDir.currentPath())  </div><div><br></div><div>    model.sort(3)</div><div>        </div><div>    table = QTableView()</div><div>    #print(table.verticalHeader().defaultAlignment()) #</div><div>    table.verticalHeader().setDefaultAlignment(Qt.AlignRight)</div><div><br></div><div>    table.setModel(model);   </div><div>    table.setRootIndex(model.index(QDir.currentPath())) # </div><div>    ui.setCentralWidget(table)</div><div>    ui.resize(800, 600)</div><div>    ui.show()      </div><div>    app.exec_()</div></div><div><br></div>