Question

I have a QTreeWidget and I want children of a QTreeWidgetItem not indent when I expand them. I want to set the line only for top items. The first screenshot demonstrates what I would like to have, and the second what I am currently having. Would you please help me with how to change it to be like the first one? Thank you in advance!

first picture

second picture![][1]

Was it helpful?

Solution

This is not possible by QTreeWidget since you can only set the indentation globally. You would need to create your own class implementing this logic, e.g. QListWidgets connected to each other, or just a brand new tree widget implementation. You could also of course improve the existing QTreeWidget and send a patch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top