code: def validate(self, qstr, editing=True):
          
          valid = self.is_valid(qstr)
          if self.hasFocus() and valid is not None:
              if editing and not valid:
                  # Combo box text is being modified: invalidate the entry
                  self.show_tip(self.tips[valid])
                  self.valid.emit(False, False)
              else:
                  # A new item has just been selected
                  if valid:
                      self.selected()
                  else:
                      self.valid.emit(False, False)
docs: Reimplemented to avoid formatting actions