I am trying to make the items in a ComboBox checkable. I tried this:
http://programmingexamples.net/wiki/Qt/ModelView/ComboBoxOfCheckBoxes
where
You can try this with QListView:
QStringList values = QStringList << "check 1" << "check 2" << "check 3" << "check 4";
QStandardItemModel model = new QStandardItemModel;
for (int i = 0; i < values.count(); i++)
{
QStandardItem *item = new QStandardItem();
item->setText(values[i]);
item->setCheckable(true);
item->setCheckState(Qt::Unchecked);
model->setItem(i, item);
}
ui->list->setModel(model);