Hi alatar,
Thanks for your response. Your solution works indeed. Also, as you pointed out in a different post, I can pass a reference to the TreeViewItem and call itemClicked() and itemDoubleClicked() from my custom component.
However, it is not just the functionality to click on items that gets lost after this change, it is also the ability to drag and drop items, select multiple items according to modifier keys, etc. This functionality is part of the TreeViewItem already, and in my case, it is a behaviour that I expect in any item of a tree (custom component or not). So having to implement it again in my custom item components does not seem very elegant.
Do you have other suggestions of how I can approach this? What I need is a tree like the one in the DemoRunner, but with labels that I can use to edit the text.