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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With