Hello,

I am using a QTableWidget to display 11 columns of data that I receive from a socket.
I receive about 200 lines of data in under 2 seconds. Each line uses a thread to make the signal/slot call for the GUI to display the data. In the GUI class, a new row is created and the line of data is parsed into the 11 different columns on the display. For some reason to update the table with all 200 lines of data, it takes close to 20 seconds. I have time print-outs around the 11 column entries, and it looks like the call to 'setItem' is the bottleneck.
Here's an example of one of the column entries:
Qt Code:
  1. start2 = QTime::currentTime ();
  2.  
  3. tbl_item = new QTableWidgetItem (QTableWidgetItem (QString (value_char)));
  4. the_table->setItem ( location_index, column, tbl_item );
  5.  
  6. end2 = QTime::currentTime ();
  7. elsp = (end2.second () - start2.second ());
  8. if (elsp > 0)
  9. logMessage (PRIORITY_DEBUG, "Elapsed flop Secs %u.%.3u",
  10. elsp,
  11. (end2.msec () - start2.msec ()));
To copy to clipboard, switch view to plain text mode 


I'm using a QTableWidget to take advantage of its search capabilities so I can make sure I am not adding duplicate data to the Table and I can update existing entries.
How I call the search:
Qt Code:
  1. QList<QTableWidgetItem*> results_list = the_table->findItems (QString::number(game_id), Qt::MatchExactly);
To copy to clipboard, switch view to plain text mode 

Should I use QTableView instead? Is it faster to add rows into the table?
What about QTableView's search capabilities, are they better than the search for QTableWidget? Does the Model/View architecture help with this?

Thanks,
DP