Quote Originally Posted by q130s View Post
The direct problem I'm facing is that my program fails to deselect a tree item when it's clicked by user.
That should work "out of the box".

The ui file that you uploaded has the selection mode set to QAbstractItemView::MultiSelection. You haven't by any chance changed that to QAbstractItemView::SingleSelection have you?
When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item by clicking on it.