Hi all,

I have a function which add a 2d array to a table. When I execute this function, a RuntimeError exception is thrown. Below is my code sample. I would be very thankful for any advice/assistance regarding this matter:

Qt Code:
  1. def array_2_table(self, array, qtable):
  2. qtable.setColumnCount(10) #rows and columns of table
  3. qtable.setRowCount(600)
  4. for row in range(600): # add items from array to QTableWidget
  5. for column in range(10):
  6. item = array[row][column] # each item is a QTableWidgetItem
  7. # add the QTableWidgetItem to QTableWidget, but exception thrown
  8. qtable.setItem(row, column, QTableWidgetItem(item))
To copy to clipboard, switch view to plain text mode 

The exact exception is: RuntimeError: underlying C/C++ object has been deleted

I would be very thankful if anyone could provide insight into this error or how one can add fixed-size 2D array to a QTableWidget.
Thanks in advance,
p.