0

I'm trying to implement a insertRow function (very similar to the overridableinsertRows). This is what I've done:

def insertRow(self, row_data, parent=QtCore.QModelIndex()):
    self.beginInsertRows(parent, self.rowCount(), self.rowCount())
    self.arraydata.append(row_data)
    self.endInsertRows()

This doesn't show anything on the QTableView itself (even though it extends the left scroller).

Where am I wrong?

iTayb
  • 12,373
  • 24
  • 81
  • 135

1 Answers1

0

The problem was that the table was empty at first, and because of that, the columnCount was also zero. I needed to call beginInsertColumns and endInsertColumns as well.

iTayb
  • 12,373
  • 24
  • 81
  • 135