In a QTableView I'm trying to add some metadata for each row. An obvious solution would be to use the Qt::UserRole
on the last column. Something like this.
QStandardItemModel* model = new QStandardItemModel();
QStandardItem* item = new QStandardItem();
item->setData("Hello", Qt::DisplayRole);
item->setData(rowMetadata, Qt::UserRole);
model->setItem(ROW_0, COL_0, item);
// Getting the metadata as follows
model->data(model->index(ROW_0, COL_0), Qt::UserRole);
Something feels wrong though. Any more intuitive solutions ?