PDA

View Full Version : QTableWidget select row after focus is lost?



grantbj74
25th October 2011, 06:46
Hi,

I have an issue with QTableWidget: if an item is edited, then focus is lost, the table doesn't update the item until another item is selected or the row is selected. Only one column is modifiable.

So if I change an item then click on a seperate write button the old value is written.

Is there an easy way to fix this or do I need to reimplement the QTableWidget class?

Ideally it would selectRow() once focus is lost.

I have started making my own CustomTableWidget class. Unfortunately there are a lot of differences to the standard settings, also mine currently appears on its own window :eek:

Thanks in advance
Brendan

alitoh
19th January 2012, 22:56
I am dealing with this very same problem right now.

Basically the "slot_rowSelected()" event is getting called, even tho the TableWidget is not highlighted (the getSelectedRows() property, however, STILL has the value of the previously selected row).

I generated a workaround by setting a boolean value that is true whenever it comes from the proper method, and false everywhere else, but this is an awful fix and SHOULD NOT be used.

Anybody has any input on the subject?

Qt 4.3.6

ChrisW67
19th January 2012, 23:22
Post a small, compilable example that demonstrates the problem.