I have a QTableView to display some informations of a database in the form of a grid. One of the fields is a path to an image and I would like to display these images in my table.
I tried something with a delegate, but I'm not really confortable with them and I couldn't get anything working. I also tried something with the role :
Qt Code:
if index.column() == 4: if role == QtCore.Qt.DecorationRole: path = "path/to/my/picture.jpg" label.setPixmap(pixmap) return labelTo copy to clipboard, switch view to plain text mode
This piece of code is inspired by something I found in another forum and that was supposed to work. However it doesn't do anything for me, only slows down the execution of my code.
Any idea why it's not working ? If you have an example with a delegate I'd appreciate it also!
Thanks for your attention
Bookmarks