Documentation for QAbstractItemModel.setData, which I've reproduced below, says that the method should return true if successful or false otherwise. My question is the following: How can this method not be successful?
bool QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole)
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.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also Qt::ItemDataRole, data(), and itemData().