How do I remove an item from a QListView
? For QComboBox
it's removeItem
but I can't find an equivalent function for QListView
.
Using pyqt4.
In QListWidget you can remove directly with takeAt()
, but not in QListView (read Qt Model/View). You should use the widget unless you need your own model. If QListView is what you want then get model, and remove, i.e. qListView.model().removeRow(row)