View Full Version : QTableWidget, selection problem

6th October 2009, 09:25

I have a QTableWidget which I can edit. After I add a new row in any location of the table, I would like this row be visible immediately and also be selected.

Now my selection mode is row selection, and singleSelection.

I tried to use clearSelection() to clear the previous selection and go to the right position. But it looks like, only the previous selection cell is cleared, the rest of the previous row is still in gray. And so on...

Anyone has an idea how to implement this? Thanks in advance.

6th October 2009, 10:08
I think the problem is caused by repaint(). But since I do the edition in another thread, I can not call repaint() in the edit function. update() is not working...

6th October 2009, 15:49
OK, the problem was solved.

After changing the table, selection mode and behavior have to be set again. Then it works.