I've got a QFrame with a QVBoxLayout and I'm adding my own custom widgets to the layout to simulate a QListWidget but with more information/functionality in the items. I add the widget to the layout and keep a reference in a member variable (this is Python):
self.sv_widgets[purchase.id] = widget
self.vl_seatView.addWidget(widget)
Then when I'm done with an item I want to remove it from the screen and clean up the reference:
self.vl_seatView.removeWidget(self.sv_widgets[purchase.id])
del self.sv_widgets[purchase.id]
Unfortunately, the widget is still being displayed on the screen! I've checked and I'm only adding it to the layout once (and indeed only one copy is displayed), tried manually calling update() on the layout, but to no avail. What's the right way to do this?