PDA

View Full Version : How to highlight a row in QTableWidget while the cursor hovers on the row?



legendwan
16th September 2010, 14:04
Hi all,
How to highlight a row in QTableWidget while the cursor hovers on the row?
My method is to respond the CellEntered signal and redraw all the widgets' background color in the table in the related slot. But the problem is after I use SetCellWidget to set a widget into a cell, and the signal cannot be catched in that cell :-( why this happen and how to fix it?
I know this method is not good. Is there any good method?
Thank you very much!

legendwan
28th December 2010, 02:05
Nobody knows that??:confused:

aamer4yu
28th December 2010, 11:41
There are 2 ways..
1) You can use delegates to draw the row background...
You will need to set the row to highlight in the delegate and based on that, do the highlighting.

2) Catch the signal of current row. Iterate over the items in that row and set background for each item.