Thanks! QTreeWidget::takeTopLevelItem() works. Stupid that I didn't try takeTopLevelItem before...