You can customize your QTreeView via a qt delegate. But if it is just for an icon, I think you can reimplement:
class MyQFileSystemModel : public QFileSystemModel {
public:
QVariant data( const QModelIndex& index, int role ) const {
if( role == Qt::DecorationRole ) {
return QVariant(QIcon(QPixmap("icon.png")));
}
return QFileSystemModel::data(index, role);
}
};
To learn about delegate, I suggest you study the examples: Spin box delegate
EDIT: you have to reimplement the method data from a QFileSystemModel, you must inherit from QFileSystemModel.
Then you do as before:
MyQFileSystemModel* model = new MyQFileSystemModel;
model->setRootPath(QDir::currentPath())
tree->setModel(model);