I'm sure this has been asked and answered a million times before but all I can find is useful "it can be done" answers, without actually saying how!
I have a QListView with a subclassed QAbstractListModel model. The items are arranged vertically as pixmaps with a bunch of text below. The problem is that if the text is longer than the width of pixmap, them the item will be pushed to the right and the alignment of the whole list will be all over the place.
I can set Qt::TextAlignmentRole for the text, but I can't find a way to do the same for the pixmap (icon).
I've set setViewMode(QListView::IconMode) (and tried various combinations of the other settings).
Also, is there an easy way of formatting the item text? Reimplementing the paint method seems overkill for something that seems to be straightforward (even if I could find some decent examples of this!)
Thanks for your help.
Bookmarks