I have two QTreeWidgetItem that are top level. I want to make the second 开发者_StackOverflow中文版the parent of the first. Calling the first one's addChild(second item) shows no change. How would I accomplish this?
You probably have to remove the item you want to reparent first using takeItem()
, and subsequently add it as a child to the new parent item.
精彩评论