I want to highlight the entire row of a my QTableWidget when I click on one cell of this row.
I already put a connection between an activation of my cell and my function highlightRow :
QObject::connect(ui->variableTableWidget,SIGNAL(cellActivated(int,int)), this, SLOT(highlightRow()));
Now I have to write my function, but I don't know how could I know which cell is activated. Is there a function in the QTableWidget that is suppose to return all activated cell ?
Call this on your table widget when it is created
setSelectionBehavior(QAbstractItemView::SelectRows);
this will make it so that when you click on a cell that row is selected
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