code: def validate(self, qstr, editing=True):
          
          if self.selected_text == qstr and qstr != '':
              self.valid.emit(True, True)
              return
  
          valid = self.is_valid(qstr)
          if editing:
              if valid:
                  self.valid.emit(True, False)
              else:
                  self.valid.emit(False, False)
docs: Validate entered path