QListWidget has a member named clear(). The docs for this method state:
void QListWidget::clear () [slot]
Removes all items and selections in the view.
Warning: All items will be permanently deleted.
How can I avoid all of the items being permanently deleted? I just want to clear the lists contents so that I can re-populate it with different data (however, I want to keep the data that was in it to display again if the user chooses to do so).
QListWidget::takeItem