[Qt-interest] Delete a QtreeWidgetItem

Sean Harmer sean.harmer at maps-technology.com
Fri Jun 12 11:10:32 CEST 2009


On Friday 12 Jun 2009 09:57:16 Sujan Dasmahapatra wrote:
> Friends
>
> How could I delete a QTreeWidgetItem *item from the
> QtreeWidget.......plss tell me someone
Please read the documentation, it is there to help you...

// For top-level items
QTreeWidgetItem* item = myTreeWidget->takeTopLevelItem( index );
delete item;
item = 0;

// For child items
QTreeWidgetItem* childItem = myItem->takeItem( index );
delete childItem;
childItem = 0;

Sean




More information about the Qt-interest-old mailing list