code: def headerData(self, index, orientation, role):
          
          d = self.declaration
          if orientation == Qt.Horizontal and role == Qt.DisplayRole:
              try:
                  return d.horizontal_headers[index] \
                      if d.horizontal_headers else index
              except IndexError:
                  return index
          elif orientation == Qt.Vertical and role == Qt.DisplayRole:
              try:
                  return d.vertical_headers[index] \
                      if d.vertical_headers else index
              except IndexError:
                  return index
          return None
docs: QHeaderView respects the following item data roles: 
                  TextAlignmentRole, 
                  DisplayRole, 
                  FontRole, 
                  DecorationRole, 
                  ForegroundRole, 
                  BackgroundRole.