tags:

views:

14

answers:

1

Is there a signal for when an entire row in the QTableWidget has been selected by pressing the buttons that are stacked on the left? I would like that to enable some functionality, but am not sure how?

Thank you in advance!

+1  A: 

You have a couple of different options. The most direct for what you've asked is to use the QHeaderView that's associated with the buttons:

// you could also use verticalHeader()
connect(tableWidget->horizontalHeader(), SIGNAL(sectionClicked(int)), ...);

Another option is to listen to the selection model:

connect(tableWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), ...)

But, this option would require that you check the selection to see if only an entire row is selected, unless your SelectionMode prevents it from being otherwise.

Kaleb Pederson