From the book I’m reading:
By default, QListWidget is read-only. If we wanted the user to edit
the items, we could set the view’s edit triggers using
QAbstractItemView::setEditTriggers(); for example, a setting of
QAbstractItemView::AnyKeyPressed means that the user can begin editing
an item just by starting to type.
So, I call the function in my code:
ui->listWidget->setEditTriggers(QAbstractItemView::AnyKeyPressed);
But when I select an item and start typing, nothing happens.
It turns out that the items themselves also have an editable flag, so after adding them I had to iterate all of them and set it. Now it’s working.