code: def focusOutEvent(self, ev):
          
          Kittens.widgets.ClickableTreeWidget.focusOutEvent(self, ev)
          # if focus is going to a child of ours, do nothing
          wid = QApplication.focusWidget()
          while wid:
              if wid is self:
                  return
              wid = wid.parent()
          # else we're truly losing focus -- stop the editor
          self._startOrStopEditing()
docs: Redefine focusOut events to stop editing