code: def set_collection(self, collection):
          
          self.beginResetModel()
          self.collection = collection
          self.sort_state = (-1, False)
          self.endResetModel()
docs: Reset sort state, set collection and emit resetModel signal