QListWidget or QListView with QItemDelegate?

QListWidget is essentially a customized version of QListView, designed for standard cases of list widgets, when all you're doing is just presenting image or text items in a list and the relationship with the underlying model is straightforward.

With QListWidget and its associated class QListWidgetItem you can e.g. insert and remove items very easily. But if you're inserting QPushButtons, then you can't use this so you might as well just use QListView and its (inherited) methods for setting the widget for a given index.

As for the signal, since you'll be creating the QPushButtons, just use

QObject::connect(my_button, SIGNAL(clicked()),...) 

to deal with that.


To differ from Matt's answer, it seems you can use your own widget on a QListWidgetItem, as pointed out in this post on qt-project.org: http://qt-project.org/forums/viewthread/17953.

This might be useful if you only have a few items to display and are not interested in the bother of cooking up a model class.