Quote Originally Posted by thecml View Post
Qt Code:
  1. for (int x = 0; x < rowOfData.size(); x++)
  2. {
  3. rowData = rowOfData.at(x).split(";");
  4. qDebug()<<rowData;
  5. for (int y = 0; y < rowData.size(); y++)
  6. {
  7. ui->tableWidgetScenarios->item(x,y)->setText(rowData[y]);
  8. }
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

It crashes whenever I try to insert my data into the tablewidget. Here's the debugger output and error message:
Assuming you don't have code elsewhere that creates table widget items, then
Qt Code:
  1. ui->tableWidgetScenarios->item(x,y)->setText(rowData[y]);
To copy to clipboard, switch view to plain text mode 
tries to access an item that does not exist. I.e. item(x, y) returns 0 and you are then calling a method on a null pointer.

See QTableWidget::setItem().

Cheers,
_