I am trying to make a file browser imitation in PyQt5. Files to be displayed in one horizontal row (similar to adobe lightroom). Used Qtreeview with two rows, 1 for filename to be displayed another for a thumbnail and QAbstractTableModel. Managed to populate filename columns using this code:
def data(self,index,role):
if not index.isValid():
return None
if index.row()==1 and role == QtCore.Qt.DisplayRole:
return (self.array[index.column()])
if index.row()==1 and role ==QtCore.Qt.TextAlignmentRole:
return QtCore.Qt.AlignCenter
tried different ways to populate thumbnails with no success. Could not find anything online to solve this. Most of tutorials and examples are for C.