Instead of creating MyCustomStandardItem I would recommend you use QStandardItem's built in mechanisms for custom data.
QStandardItem::setData ( const QVariant & value, int role = Qt::UserRole + 1 )
To copy to clipboard, switch view to plain text mode
The data can then be retrieved with
QVariant QStandardItem::data ( int role = Qt::UserRole + 1 )
To copy to clipboard, switch view to plain text mode
To draw the items properly in your widget create a custom QItemDelegate or QStyledItemDelegate
You also mention you are using a tree view. Consider QTreeWidget then you can use QTreeWidgetItemIterator to iterate over all of the items and extract data from them.
Bookmarks