You have several different options. The most direct for what you requested is to use a QHeaderView associated with 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 parameter requires that you check the selection to see if only the whole row is selected, unless SelectionMode allows it from another.