'Set the model for the view.
:type model: QAbstarctItemModel.'

def setModel(self, model):

    if (self._model is model):
        return
    if (self._model is not None):
        self.__disconnect(self._model)
    self._clear()
    self._model = model
    if (self._model is not None):
        self._initialize(model)
        self.__connect(model)
