Sets the model this view represents. :qtdoc:`Re-implemented<QAbstractItemView.setModel>`

        :param model: model to set
        :type model: :class:`QStimulusModel<sparkle.gui.stim.stimulus_model.QStimulusModel>`

def setModel(self, model):
        """Sets the model this view represents. :qtdoc:`Re-implemented<QAbstractItemView.setModel>`

        :param model: model to set
        :type model: :class:`QStimulusModel<sparkle.gui.stim.stimulus_model.QStimulusModel>`
        """
        super(StimulusView, self).setModel(model)
        self.setSelectionModel(ComponentSelectionModel(model))
        # initialize nested list to appropriate size
        self._rects = [[None] * self.model().columnCountForRow(x) for x in range(self.model().rowCount())]

        self._viewIsDirty = True
        self._calculateRects()