6

I'd like know how to create a QListView with custom list items. I have a small sprite animation I want to display on the left side of each entry, and some information as well as a few push buttons on the right side. I need to be able to detect clicks on the title as well.

I've looked into QListView, but found nothing I could use to do this. A few similar questions pointed me towards QAbstractItemDelegate and QAbstactListModel, but without example code, I can't wrap my head around it. I'm stuck at overriding QAbstractItemDelegate's paint() method - I just don't know how to override it in a way that produces the intended effect.

Your replies are much appreciated!


i.e. I'm looking to create something like this: enter image description here

Community
  • 1
  • 1
sorbet
  • 2,150
  • 25
  • 40
  • See also [How to customize Listview in Qt using Delegates.](http://qt-articles.blogspot.de/2010/07/how-to-customize-listview-in-qt-using.html) or [Custom QWidget in a QListView/QListWidget or QTableView cell](http://manuel.insanefactory.com/2011/09/custom-qwidget-in-a-qlistviewqlistwidget-or-qtableview-cell/). – Trilarion Sep 16 '14 at 15:06
  • 1
    possible duplicate of [QListView/QListWidget with custom items](http://stackoverflow.com/questions/948444/qlistview-qlistwidget-with-custom-items) – Trilarion Sep 16 '14 at 15:07

0 Answers0