QAIM: return false if nothing was (or could be) done in setItemData
Setting item data on an invalid index, or with an empty map, surely is not a successful operation. [ChangeLog][Core][QAbstractItemModel] Calling setItemData with an invalid index or empty map of data returns false. Change-Id: Id087581243c8fa39a8cc78b811ecd087deea4466 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
39015c049b
commit
9c87c99180
@ -2086,6 +2086,9 @@ bool QAbstractItemModel::clearItemData(const QModelIndex &index)
|
|||||||
*/
|
*/
|
||||||
bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles)
|
bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles)
|
||||||
{
|
{
|
||||||
|
if (!index.isValid() || roles.isEmpty())
|
||||||
|
return false;
|
||||||
|
|
||||||
// ### TODO: Consider change the semantics of this function,
|
// ### TODO: Consider change the semantics of this function,
|
||||||
// or deprecating/removing it altogether.
|
// or deprecating/removing it altogether.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user