Using QStandardItem::setData() or QAbstractItemModel::setData() depending on what you're operating on.
Thank you. I was confused because the documentation says:
I thought for use setData() is necessary implement this virtual function because by default returns false....Sets the role data for the item at index to value.
Returns true if successful; otherwise returns false.
The dataChanged() signal should be emitted if the data was successfully set.
The base class implementation returns false. This function and data() must be reimplemented for editable models.
It returns false in QAbstractItemModel. But QStandardItemModel is a subclass of it which reimplements this method.
Thank you, setData() is what I needed.
Bookmarks