How to display icons in QTableView via a custom QAbstractItemModel?
I’m building a custom QAbstractItemModel model.
The first column contains icons, the second one – text.
This is the code of the data method:
But all I get in the resulting Table View is just text in the second column. There’s no folder icon in the first column.
I know I have to use Qt::DecorationRole, however I never receive it in the role parameter!
So silly of me. The solution is obvious: