A new role doesn't have to be added to TableModel::data(...) anymore.
This commit is contained in:
@ -78,20 +78,17 @@ QVariant TableModel::data(const QModelIndex& index, int role) const {
|
|||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
return m_items.at(row)->data(roleForColumn);
|
return m_items.at(row)->data(roleForColumn);
|
||||||
case NameRole:
|
|
||||||
case DescriptionRole:
|
|
||||||
case InfoRole:
|
|
||||||
case TypeRole:
|
|
||||||
case AmountRole:
|
|
||||||
case FactorRole:
|
|
||||||
case IdRole:
|
|
||||||
return m_items.at(row)->data(role);
|
|
||||||
case ToStringRole:
|
case ToStringRole:
|
||||||
return m_items.at(row)->toString();
|
return m_items.at(row)->toString();
|
||||||
case ToJsonRole:
|
case ToJsonRole:
|
||||||
return m_items.at(row)->toJsonObject();
|
return m_items.at(row)->toJsonObject();
|
||||||
|
case IdRole:
|
||||||
|
return m_items.at(row)->data(role);
|
||||||
|
default:
|
||||||
|
if (USER_FACING_ROLES.contains(role)) {
|
||||||
|
return m_items.at(row)->data(role);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user