QListWidget 有一个名为 clear() 的成员。此方法的文档状态:
void QListWidget::clear () [slot]
Removes all items and selections in the view.
Warning: All items will be permanently deleted.
如何避免所有项目被永久删除?我只想清除列表内容,以便我可以用不同的数据重新填充它(但是,如果用户选择这样做,我想保留其中的数据以再次显示)。
QListWidget 有一个名为 clear() 的成员。此方法的文档状态:
void QListWidget::clear () [slot]
Removes all items and selections in the view.
Warning: All items will be permanently deleted.
如何避免所有项目被永久删除?我只想清除列表内容,以便我可以用不同的数据重新填充它(但是,如果用户选择这样做,我想保留其中的数据以再次显示)。