Reputation: 25094
I want to add a custom Widget to the QListView, i read already the SO thread about Delegates. QListView/QListWidget with custom items and custom item widgets
But how is this applied in pyqt? i couldn't find any example. Some articles show how to overwrite the paint function, which will only change the appearance but not add a widget as an item.
Upvotes: 0
Views: 2430
Reputation: 4159
setCellWidget() if you can switch to QListWidget or QTableWidget add custom widget to QTableWidget cell
...or you can just spawn new Widget in a cell rectangle via delegate like I do here: delegate that edits bound python object properties
We used code like this to handle text, number, date, boolean, image, document file, coordinate, list properties etc of our domain objects.
Upvotes: 2