TableModel::setData can now be called for column 0 with different roles to edit. (Doesn't rely on Qt::EditRole and RoleForColumn in all cases)

This commit is contained in:
2026-03-09 07:46:28 +01:00
parent a6648b7d1e
commit c1ee2135df
3 changed files with 28 additions and 9 deletions

View File

@ -28,11 +28,11 @@ static UserRoles DEFAULT_ROLE = NameRole;
static QList<UserRoles> USER_FACING_ROLES = {NameRole, DescriptionRole, InfoRole,
TypeRole, AmountRole, FactorRole};
static QHash<int, QByteArray> ROLE_NAMES = {
{NameRole, "name"}, {DescriptionRole, "description"},
{InfoRole, "info"}, {TypeRole, "type"},
{AmountRole, "amount"}, {FactorRole, "factor"},
{ToStringRole, "ToString"}, {IdRole, "id"},
{Qt::DisplayRole, "display"}};
{NameRole, "name"}, {DescriptionRole, "description"},
{InfoRole, "info"}, {TypeRole, "type"},
{AmountRole, "amount"}, {FactorRole, "factor"},
{ToStringRole, "ToString"}, {IdRole, "id"},
{Qt::DisplayRole, "display"}, {Qt::EditRole, "edit"}};
static QList<UserRoles> STRING_ROLES = {NameRole, DescriptionRole, InfoRole, IdRole};
static QList<UserRoles> INT_ROLES = {AmountRole};