How to get the row number of checked radio button in QTableWidget
I'm using a QTableWidget which has 62 rows and 5 columns. I have a QRadioButton on 1st column of each row.
Quote:
for(int x = 0; x < 62; x++)
{
rbDeviceSelect[x] = new QRadioButton();
oDevStatePanel->setCellWidget(x, 0, rbDeviceSelect[x]);
}
I need to get the row number of the checked QRadioButton, from which I have to get the text from the 2nd column of the same row.
How can I do this ?
Thank you.
Re: How to get the row number of checked radio button in QTableWidget
Use QTableWidget::indexFromItem if you know the item. This method return index which is QModelIndex, and use QModelIndex::row