I have a QTreeWidget whose contents is changed based on which document is currently active. Each document stores the items as a QTreeWidgetItem representing the root of the tree so that I can easily pass it to recursive functions for processing the tree, but this item is really supposed to play the role of the "invisible root node" in the QTreeWidget. That is, the children of that node are meant to appear as the top level items.

What is the best way to achieve this? If I simply add the children of the root as top level items of the QTreeWidget, they don't appear at all, and there is no corresponding setter for the invisibleRootNode property.