- I have one QTableWidget
- I have 10 columns (may get more)
- I have 800 rows

For each row, I have a data holder class which keeps the selection state. This data holder can get its selection state from a graphical viewer or from the table.
The user selects using the QTableWidgets built-in selection (click, ctrl+click, shift+click and the small rectangle in the corner to select all ).
I have connected the holder class to the table's itemSelectionChanged() signal. It then checks the selection state of the first QWidgetItem of the row it has the responsibility for. The selection state of the data is updated according to the state in the table.
I have set up row-selection:
myTable->setSelectionBehavior(QAbstractItemView::SelectRow s);

When, for instance, the user selects all by clicking the small rectangle in the top left corner of the table, the table emits one itemSelectionChanged() for each and every QTableWidgetItem in the table. And when I have 8000 signals sent to 8000 connections, you don't need that much of imagination to see that this is a performance issue.

When I deselect all, it only emits one itemSelectionChanged() to each of the 8000 connections, and there is no big issue, but I don't like that either.

What I need is a signal so that the holder class could listen to one specific QTableWidgetItem, but it does not seem to exist. I tried to subclass the QTableWidgetItem and re-implement the setSelected() function, but since setSelected(bool) is not virtual, that was a dead end.

Anyone have any suggestion?