"void QListViewItem::takeItem ( QListViewItem * item ) [virtual]
Removes item from this object's list of children and causes an update of the screen display. The item is not deleted. You should normally not need to call this function because QListViewItem::~QListViewItem() calls it."
要那个就删那个。。delte item;一次删除一个,循环即可完全删除:
由于整个程序代码太多这是一点点:(删除选中的;)
for ( ; it.current(); ++it )
{
// ...check state of childs, and...
if ( it.current()->parent() )
{ // ...if the item is checked...
if ( ( (QCheckListItem*)it.current() )->isOn() )
{// ...set the text of the item to the label
label->setText( it.current()->text( 0 ) );
delete (QCheckListItem*)it.current();
}
}
}