I know you can do it when you have access to the QStandardItemModel
but using combobox->model()
returns a QAbstractItemModel
which doesn't have the item(int row, int col)
accessor. I've tried working with QAbstractItemModel::itemData(QModelIndex)
but can't get it to work as I require.
I just need to get the CheckState of the items, if(item.checkState() == Qt::Checked) etc...
Edit: I have this code, can I cast it to a QStandardItem?
QModelIndex index(1, 0);
QVariant item = ui->SearchAssessmentCombo->model()->data(index, Qt::CheckStateRole);