frmdstryr / enamlx

Additional Qt Widgets for Enaml
MIT License
28 stars 9 forks source link

[BUG] Tree parent is triggered when clicking on child node #28

Open Kochise opened 3 years ago

Kochise commented 3 years ago

Hi, just experienced a strange behavior of the TreeViewItem object.

When clicking on a child, the parent gets triggered as well.

enamlx_tree_child_trigger_red

tree_view.enaml.txt

Kochise commented 2 years ago

Still experiencing the issue :

TreeItemNode ObjectTypes selection_changed
TreeItemNode Types pressed <- PARENT (???)
TreeItemNode ObjectTypes pressed
TreeItemNode Types clicked <- PARENT (???)
TreeItemNode ObjectTypes clicked
TreeItemNode VariableTypes selection_changed
TreeItemNode ObjectTypes selection_changed <- SIBLING (previously clicked)
TreeItemNode Types pressed <- PARENT (???)
TreeItemNode VariableTypes pressed
TreeItemNode Types clicked <- PARENT (???)
TreeItemNode VariableTypes clicked

Is there any reasoning behind this behavior ? I have to filter things to avoid fetching the wrong data on click event.

capture_20221007_145642_002_click

frmdstryr commented 2 years ago

Feel free to create a pull request.

Kochise commented 2 years ago

Hacked in a little event filter. Not a silver bullet though.

enamlx_tree_click_filter

Still dunno the difference between pressed and clicked.

And why both clicked and double_clicked have to be emitted.