How can I remove an item with text "something" from a QStandardItemModel that filled with QStandardItem items and shown in a QListView in pyqt.
I made my QStandardItemModel like code shown below:
item = QtGui.QStandardItem("something")
QStandardItemModel.appendRow(item)
You will first need to find the items with the matching text, and then remove them from the model:
model = listview.model()
for item in model.findItems('something'):
    model.removeRow(item.row())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With