Custom role for a custom model
Unsolved
General and Desktop
-
"internal roles" are the roles already predefined by Qt (
Qt::ItemDataRole
).As you see in the API the
data(...)
method treats the role as an int so you're free to specify it as enum, as #define or as magic number - wherever you want. As long as you use values greater or equalQt::UserRole
ot prevent conflicts (but the prefered way is to specify an enum, see @VRonin).Depending on what you want to to with the values associated with your roles you have to extend your view so your roles must be at least so "global" that they are known by the model and by the corresponding view.