Cannot set header data with QTableView / custom table model
问题 I am on Maya / PySide2 / Python 2.7 I cannot set the header data with a custom table model. I tried this: from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import Qt class TableModel(QtCore.QAbstractTableModel): def __init__(self, data): super(TableModel, self).__init__() self.setHeaderData(0, Qt.Horizontal, "Driver") self.setHeaderData(1, Qt.Horizontal, "Range") self.setHeaderData(2, Qt.Horizontal, "Driven") self.setHeaderData(3, Qt.Horizontal, "Range") self._data = data def