franco.amato
20th January 2022, 16:17
Hi community,
I am working with a QTreeWidget.
I have a structure like this:
A -> A1, A2, A3
B -> B1, B2, B3
C -> C1, C2, C3
Where A, B and C are top-level nodes and the others are their respective children.
I need to, after selecting any top-level node A, B or C, to select all their respective children
For example:
If I select A ( with the mouse ), then I need A1, A2 and A3 to be selected too.
Looking at the documentation I saw the method QTreeWidgetItem::takeChildren(), but this will also remove the children. In my case I need them not to be removed, only selected.
Any help please?
Regards
Added after 18 minutes:
I need this behavior in my QTableWidget::startDrag method.
When I select a top-level node, I need to drag and drop all its children
I am working with a QTreeWidget.
I have a structure like this:
A -> A1, A2, A3
B -> B1, B2, B3
C -> C1, C2, C3
Where A, B and C are top-level nodes and the others are their respective children.
I need to, after selecting any top-level node A, B or C, to select all their respective children
For example:
If I select A ( with the mouse ), then I need A1, A2 and A3 to be selected too.
Looking at the documentation I saw the method QTreeWidgetItem::takeChildren(), but this will also remove the children. In my case I need them not to be removed, only selected.
Any help please?
Regards
Added after 18 minutes:
I need this behavior in my QTableWidget::startDrag method.
When I select a top-level node, I need to drag and drop all its children