Thanks faldżip,
I did see the cellWidget method, but it wasn't working the way I was using it (which was similar to the line you gave me). That made me think it wasn't the way to access the checkbox. Your line made me look further and this is what I found.
If I use 'selected' to get at the row or column,
QCheckBox *cb
= qobject_cast<QCheckBox
*>
(m_ui
->tableWidget
->cellWidget
(selected
[6]->row
(), selected
[6]->column
()));
QCheckBox *cb = qobject_cast<QCheckBox *>(m_ui->tableWidget->cellWidget(selected[6]->row(), selected[6]->column()));
To copy to clipboard, switch view to plain text mode
the program halts on a signal at that line.
The only way I found that works is to hard code the column in there and use item-row() to get the row:
QCheckBox *mcb
= qobject_cast<QCheckBox
*>
(m_ui
->tableWidget
->cellWidget
(item
->row
(),
6));
QCheckBox *mcb = qobject_cast<QCheckBox*>(m_ui->tableWidget->cellWidget(item->row(), 6));
To copy to clipboard, switch view to plain text mode
Six is the correct column. There are seven columns in my table.
This is no biggie, as the column that hold the checkbox won't change, but I'd like to know if there's a problem in the way I'm implementing on_tableWidget_itemSelectionChanged that is causing this.
Bookmarks