PDA

View Full Version : QTableWidget, selection problem



stella1016
6th October 2009, 10:25
Hello,

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.

stella1016
6th October 2009, 11: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...

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

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