Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It is necessary to implement 2 methods in the tabular data model class and call setHeaderData by inserting a list with column names (ATTENTION: the number of names must match the number of columns in the data)
def setHeaderData (self, int, Orientation , Header: list, role: int = Qt.ItemDataRole.EditRole):
self.header = Header
def headerData(self, section, orientation, role):
if role == QtCore.Qt.DisplayRole:
if orientation == QtCore.Qt.Horizontal:
return self.header[section]
if orientation == QtCore.Qt.Vertical:
return str("List ") + str(section)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question