PDA

View Full Version : Where to mouse clicks go from QTableWidget headers?



mclark
29th August 2006, 14:50
My app has 2 QTableWidget objects. I need to know when the user selects a row in one of the tables by clicking on a row header. mouseReleaseEvent() tells me when the user clicks anywhere inside the table but not when a row header is clicked (which selects all cells in the table row). What can I use to trap these mouse clicks?

jacek
29th August 2006, 15:03
Connect to QHeaderView::sectionClicked() signal (you can obtain QHeaderView object using QTableView::horizontalHeader()).

e8johan
29th August 2006, 15:04
You want to get the QHeaderView for the table widget (using the horizontalHeader member function).

mclark
29th August 2006, 15:07
Thanks so much! I knew there must be an easy way but I just couldn't find it. (I'm getting Qt training... but after the first release of the product:confused: !)