code: def headerData(self, section, orientation, role):
          
          if role == QtCore.Qt.DisplayRole:
              if orientation == Qt.Horizontal:
                  return self.attrNames[section]
              else:
                  return str(section)
          else:
              return None
docs: Returns the header for a section (row or column depending on orientation).
              Reimplemented from QAbstractTableModel to make the headers start at 0.