code: def refreshUi(self):
          
          font = self.currentFont()
          
          for name in ('underline', 'bold', 'italic', 'strikeOut'):
              getter = getattr(font, name)
              act = self._actions[name]
              act.blockSignals(True)
              act.setChecked(getter())
              act.blockSignals(False)
docs: Matches the UI state to the current cursor positioning.