Thanks for the response and guidance @Lykurg. The problem of getting different address from QModelIndex may not be necessarily a problem but I suspect it is the cause after many hours of observation.

The direct problem I'm facing is that my program fails to deselect a tree item when it's clicked by user. QItemSelectionModel.select method takes index as an argument to make the selection either selected or deselected, and as far as I've seen the method seems not to deselect when getting different address from previous selection action. For example, the following code doesn't deselect the item clicked.

Qt Code:
  1. def __init__(self):
  2. self.selectionModel = QItemSelectionModel()
  3. self.selectionModel.currentChanged.connect(
  4. self._currentChanged_slot)
  5.  
  6. def _currentChanged_slot(self, qindex_curr, qindex_prev):
  7. self.selectionModel.select(qindex_curr,
To copy to clipboard, switch view to plain text mode