hi, I have a problem with a Table View. It has got 2 columns, the first with checkboxes, the second have Strings coming out from a DB query.
I need to save a file containing only the cells in the second coloumn with checked checkboxes(in the 1st one).
I fill the first column with this portion of code:
for (row=0; row<model->rowCount(); row++){
ch->setObjectName(name);
ch->setChecked(Qt::Checked);
view->setIndexWidget(model->index(row,0),ch);}
for (row=0; row<model->rowCount(); row++){
QString name="check_"+QString::number(row+1);
ch = new QCheckBox(name);
ch->setObjectName(name);
ch->setChecked(Qt::Checked);
view->setIndexWidget(model->index(row,0),ch);}
To copy to clipboard, switch view to plain text mode
after filling the first column in this way I can't access the state of the checkboxes to select the rows that I want to save in the file.
I am unable to get the state of the checkboxes maybe for the wrong way i used to set the object name.
have you got any idea to help me? thanks in advance!
Bookmarks