I have a QTreeWidget that basically displays files. Each segment of the path is a child of the previous path segment, ending with the file path filename, which is childless.I want to collapse this tree to show only the directories. I can do this by traversing the tree and setHidden for all the childless items. The problem is any directory segments that have no directory segments below them don't display the child Indicator, even if I setChildIndicatorPolicy to QTreeWidgetItem::ShowIndicator. I can't use collapseAll because it collapses everything down to the root directory of the drive.

If this isn't enough information, I can post screen shots and code snippets.