QTreeWidget with Tristate
Unsolved
General and Desktop
-
I need to implement a QTreeWidget with group nodes and leaf nodes. I want only the group nodes to be in tristate mode. I set the group nodes to tristate mode using setflags(..) which is not done for the leaf nodes. When I run the code, clicking the checkbox cycles through all three states not just check and unchecked as desired. I've also tried setting Qt::ItemNeverHasChildren for the leaf nodes but it has no effect. What have I missed? Thanks for the help.
-
Hi, welcome to devnet.
Flags are propagated to the children so you can either set all wanted flags on the child explicitly to overwrite whatever came from the parent, or unset just the tri-state flag on the child.