1.- try to use a custom delegate to center the image in the item
1.- try to use a custom delegate to center the image in the item
Well, I have looked at a number of examples of custom delegates, but they all seem to be designed for editing, not just display. For some reason I am not able to make the connection on how to do what I am trying to achieve. Have you seen any good examples out there that I might have missed?
Delegate is capable of doing that, and good thing about delegates is that Your model is intact so You can still use others views with the same model without any changes in code.
In model place your Images in UserRole (or any other role, depends what You will do in the delegate), then add custom delegate to the view.
Subclass, for example QStyledItemDelegate, and override paint() and paint You "stuff" centered. Simply calculate column and row width/height and /2 to offset image imageWIdth-Height/2.
Good example is here: http://doc.trolltech.com/4.3/itemvie...rdelegate.html
Bookmarks