federem
federem

Reputation: 299

Remove an item of a tree in Qt

I try to remove an item in a QTreeWidget. How can I remove it ? I just want to remove it, not to delete it and I don't find any method.

Upvotes: 0

Views: 265

Answers (3)

Ashif
Ashif

Reputation: 1684

You can try with takeTopLevelItem() API, It only removes the item.

Upvotes: 1

WoJo
WoJo

Reputation: 370

if have the item QTreeWidgetItem call setHidden(bool) you can get the titem by calling topLevelItem(int index) from the tree widget

Upvotes: 0

Exa
Exa

Reputation: 4110

You can use QTreeWidgetItem::setHidden on the item you want to hide.

Upvotes: 0

Related Questions