code: def filterAcceptsRow(self, row_num, parent):
          
          model = self.sourceModel()
          name = model.row(row_num).name
          r = re.search(self.pattern, name)
  
          if r is None:
              return False
          else:
              return True
docs: Qt override.
  
          Reimplemented from base class to allow the use of custom filtering.