fix: add support for custom roles again

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2022-10-01 22:31:49 +02:00
parent b0dc7927fb
commit adc27f0577
No known key found for this signature in database
GPG Key ID: C10411294912A422
2 changed files with 9 additions and 2 deletions

View File

@ -211,6 +211,14 @@ QVariant InstanceList::data(const QModelIndex& index, int role) const {
}
break;
}
case InstanceIDRole: {
return inst->id();
}
case GroupRole: {
return getInstanceGroup(inst->id());
}
}
return QVariant();
}

View File

@ -88,8 +88,7 @@ public:
{
SortRole = Qt::UserRole + 1,
GroupRole,
InstancePointerRole, ///< Return pointer to real instance
InstanceIDRole ///< Return id if the instance
InstanceIDRole
};
/*!
* \brief Error codes returned by functions in the InstanceList class.