Hi!

I'm trying to show numbers in a QTableWidget, but my following code is showing nothing! There is no compile error. What's going on?
Qt Code:
  1. for(int i = 0; i < LINES; i++)
  2. {
  3. for(int j = 0; j < COLS; j++)
  4. {
  5. QTableWidgetItem val( QString::number( 123 ) );//This number is only for test.
  6. ui->tableWidget->setItem(i, j, &val);
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

Thanks!