Hello,

I know there have been similar questions, but I did not find my specific problem. Well here is what I did:

- subclassed QTreeView
- subclassed QStandardItem: implemented clone() data() setData() type()
- subclassed QStandardItemModel
- subclassed QItemDelegate

Now, what I wanted is that the delegate does not operate directly on the text the users sees (Qt::DisplayRole) but on the edit role (Qt::EditRole). I expected that when I set QStandardItemModel::setItemPrototype to my subclassed QStandardItem it will call the data() and setData() functions of the subclass.
Well, this does not seem to be the case. It still uses the base class data() and setData() functions. Only when i also overwrote data() and setData() for my subclass of QStandardItemModel, then the behaviour was as expected.

So, why is it necessary to call setItemPrototype() at all, when I have to overwrite data() and setData() for my subclass of QStandardItemModel anyways (and there I can use the correct type)? Also I found this by try-and-error, I don't think this is documented anywhere.

Maybe someone has tried this before?