I have a QListView displaying a QStringListModel with a bunch of file paths loaded by the user. These file paths each correspond to a custom QFile that I developed. Once the user loads new paths, I verify whether the file at each path is valid (correct extension, formatting, version, etc). When the validation algorithm detects an invalid file, it emits a signal to that effect.

I would like to recolor items in the QItemView as red and add a tooltip to indicate that the file is invalid. Can I do this without subclassing QItemView, or can this be accomplished with QStyledItemDelegate? I don't really understand how delegates fit into the Model/View architecture since I'm not trying to create an editor.

I'm guessing that this is accomplished using Style Sheets, but I can't figure out how to access a single row's style sheet. Any pointer in the right direction would be appreciated.