The treeview has an editable delegate. So when I'm editing an item on the treeview and click an item in the listview, I would like the item which is in edit mode to loose focus.
I meant I would like to change the edit mode to non-edit mode, if a user clicks on any other item on the qml page.

Let me explain the scenario, I have buttons, a treeview and listview in the same screen. When I enable the item to be edited and start editing the item in the treeview by setting activeFocus, so that the keyboard key strokes are accepted by the textedit.

Now if I click on some other button on the screen or any item in the listview without setting the activeFocus on the item I just clicked, the activeFocus of the item in the treeview isn't lost, this activeFocus loss is used to set the text and change the edit mode to non-edit mode.

So currently i'm setting activeFocus explicitly on the item I clicked(i.e. button or item in the listview) other than the treeview item to disable the activeFocus on the treeview item.

Is there a better way to shift activeFocus from the treeview item rather than configuring activeFocus on any other item which is clicked?