If I understand your question correctly, you want something like this:
where each row contains a custom set of widgets.
To achieve this, two steps.
Implement the row with a custom Widget
First, implement a custom widget that contains all the widgets needed per list row.
Here I am using a label and two buttons per row, with an horizontal layout.
class MyCustomWidget(QWidget):
def __init__(self, name, parent=None):
super(MyCustomWidget, self).__init__(parent)
self.row = QHBoxLayout()
self.row.addWidget(QLabel(name))
self.row.addWidget(QPushButton("view"))
self.row.addWidget(QPushButton("select"))
self.setLayout(self.row)
Add rows to the list
Instanciating multiple rows is then just a matter of creating a widget item, and associate the custom widget to the item's row.
# Create the list
mylist = QListWidget()
# Add to list a new item (item is simply an entry in your list)
item = QListWidgetItem(mylist)
mylist.addItem(item)
# Instanciate a custom widget
row = MyCustomWidget()
item.setSizeHint(row.minimumSizeHint())
# Associate the custom widget to the list entry
mylist.setItemWidget(item, row)