In setModelData for my delegate I perform this code

Qt Code:
  1. void ShipComponentDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
  2. {
  3. QString name = index.model()->data(index, Qt::DisplayRole).toString();
  4. QSize size(0,0);
  5. QVariant var = QVariant(size);
  6. model->setData(index, var,Qt::SizeHintRole);
  7. size = model->data(index, Qt::SizeHintRole).toSize();
  8. }
To copy to clipboard, switch view to plain text mode 
size taken from model after setting should be the same as above. But it isn't. I thought first time that I made some error with values inserted into size and it is invalid. But no - in every other case with all other values - it doesn't want to change internal data.
To clarify all - in setEditorData() I fill this index with my size - then after changes I want to bring this size to previous value.