Can someone point me to an example / tutorial / explanation of how to correctly use Qt::UserRole in the Model / View architecture?

If I set user role data into my model items, how or when will the model's data() method be called with a role value corresponding to my user role?

Does the act of calling setData() with a role >= Qt::UserRole result in an entry being made in a dispatch table somewhere in the model that tells it to add this role to the list of other roles that are called via the data() method?

If not, then in general how or where should user role data be retrieved by an application that uses it?

I've read the Qt documentation and tutorials covering the model / view architecture and classes, and while there are frequent references to the concept that "user roles can be used for application-specific purposes", I can't find anything that tells how such roles are actually integrated into the architecture.

Thanks in advance for any information.