code: def focus_changed(self):
          
          fwidget = QApplication.focusWidget()
          for finfo in self.data:
              if fwidget is finfo.editor:
                  self.refresh()
          self.editor_focus_changed.emit()
docs: Editor focus has changed