If setting the Qt::DisplayRole is working then just use that. However:
item
->setData
(QVariant(12345), Qt
::EditRole);
column5.append(item);
QStandardItem *item = new QStandardItem();
item->setData(QVariant(12345), Qt::EditRole);
column5.append(item);
To copy to clipboard, switch view to plain text mode
and, elsewhere:
model->setSortRole(Qt::EditRole);
model->setSortRole(Qt::EditRole);
To copy to clipboard, switch view to plain text mode
This makes all the columns in the model sort on the edit role.
Bookmarks