'Set the item model for preview.'

def setModel(self, model):

    if (self.__model != model):
        if self.__model:
            s_model = self.__previewList.selectionModel()
            s_model.selectionChanged.disconnect(self.__onSelectionChanged)
            self.__model.dataChanged.disconnect(self.__onDataChanged)
        self.__model = model
        self.__previewList.setModel(model)
        if model:
            s_model = self.__previewList.selectionModel()
            s_model.selectionChanged.connect(self.__onSelectionChanged)
            self.__model.dataChanged.connect(self.__onDataChanged)
        if (model and model.rowCount()):
            self.setCurrentIndex(0)
