code: def edit_finished(self):
          
          # Hides editor
          self.hide()
  
          if isinstance(self.tab_index, int) and self.tab_index >= 0:
              # We are editing a valid tab, update name
              tab_text = to_text_string(self.text())
              self.main.setTabText(self.tab_index, tab_text)
              self.main.sig_change_name.emit(tab_text)
docs: On clean exit, update tab name.