class TableModel(QAbstractTableModel):
    header_labels = ['Column 1', 'Column 2', 'Column 3', 'Column 4']

def __init__(self, parent=None):
    QAbstractTableModel.__init__(self, parent)

def headerData(self, section, orientation, role=Qt.DisplayRole):
    if role == Qt.DisplayRole and orientation == Qt.Horizontal:
        return self.header_labels[section]
return QAbstractTableModel.headerData(self, section, orientation, role)
how to set the QTableView header name in Pyqt4