Hi All,

I have a QTableWidget that I add rows during runtime using the following type of code:
Qt Code:
  1. bool QTClient::addToTable (int id, int lobby_view, QString name)
  2. {
  3. int column = 0;
  4.  
  5. ui.m_TableWidget->insertRow(ui.m_TableWidget->rowCount ());
  6.  
  7. QTableWidgetItem* tbl_item = new QTableWidgetItem (QString::number(id));
  8. ui.m_TableWidget->setItem ( location_index, column++, tbl_item );
  9.  
  10. tbl_item = new QTableWidgetItem (QTableWidgetItem (QString::number(lobby_view)));
  11. ui.m_TableWidget->setItem ( location_index, column++, tbl_item );
  12.  
  13. tbl_item = new QTableWidgetItem (QTableWidgetItem (name));
  14. ui.m_TableWidget->setItem ( location_index, column++, tbl_item );
  15.  
  16. ui.m_holdemAllTableWidget->update ();
  17. }
To copy to clipboard, switch view to plain text mode 

I have a button on my window that calls this code when pressed and the new line is added and displayed just fine in the table.

However, the problem comes when this add method is called from a thread.
When my thread fires it also calls the addTable method, but the data does not show up on the screen. The row count on the table increases, but the new data does not display.

Does anyone have any ideas why I can not see data added to my table from a thread?

Thanks in advance,
Derrick