'Update the column and row numbering in the headers.'

def reset_headers(self):

    rows = self.rowCount()
    cols = self.columnCount()
    for r in range(rows):
        self.setVerticalHeaderItem(r, QTableWidgetItem(str(r)))
    for c in range(cols):
        self.setHorizontalHeaderItem(c, QTableWidgetItem(str(c)))
        self.setColumnWidth(c, 40)
