[SOLVED]i want to do sth when i expand or collapse a QTreeWidgetItem
i want to do sth when i expand or collapse a QTreeWidgetItem.
i saw there are publis SLOTS in the QTreeWidget, and i override them in my inherit class, but it donot work.
i will try signal itemExpanded/Collapsed, and i guess it will work.but, i will send the signal to the slot in the same class, from this to this.
i want to know what is the normal way to do this?
SGaist Lifetime Qt Champion last edited by
If you are talking about e.g. collapseItem then it's normal yours is not called, it's not a virtual slot. Also, it's not a slot that reacts on the collapse of an item but that does it. You should connect itemExpanded to a custom slot named e.g. onItemExpanded.