void Tool::clearListWidget(QListWidget *listWidget)
{
if (nullptr == listWidget)
{
return;
}
while (0 != listWidget->count())
{
QListWidgetItem *item = listWidget->item(0);
QWidget *widget = listWidget->itemWidget(item);
if (nullptr != widget)
{
listWidget->removeItemWidget(item);
widget->deleteLater();
}
item = listWidget->takeItem(0);
delete item;
item = nullptr;
}
}
QListWidget删除Item及itemWidget
最新推荐文章于 2024-09-14 16:26:17 发布
关键词由CSDN通过智能技术生成