Remove selected items from listWidget

One way to remove item from QListWidget is to use QListWidget::takeItem which removes and returns the item : QList<QListWidgetItem*> items = ui->listWidget->selectedItems(); foreach(QListWidgetItem * item, items) { delete ui->listWidget->takeItem(ui->listWidget->row(item)); } Another way is to qDeleteAll : qDeleteAll(ui->listWidget->selectedItems());

QListWidget and Multiple Selection

Unfortunately I can’t help with the Python specific syntax but you don’t need to create any subclasses. After your QListWidget is created, call setSelectionMode() with one of the multiple selection types passed in, probably QAbstractItemView::ExtendedSelection is the one you want. There are a few variations on this mode that you may want to look at. … Read more

QListView/QListWidget with custom items and custom item widgets

I think you need to subclass QItemDelegate. QItemDelegate can be used to provide custom display features and editor widgets for item views based on QAbstractItemView subclasses. Using a delegate for this purpose allows the display and editing mechanisms to be customized and developed independently from the model and view. This code is taken from Qt’s … Read more