'Reimplemented from :func:`QWidget.sizeHint`.'

def sizeHint(self):

    if (self.__sizeHint is None):
        view = self.view()
        model = view.model()
        count = model.rowCount(view.rootIndex())
        width = view.sizeHintForColumn(0)
        if count:
            height = view.sizeHintForRow(0)
            height = (height * count)
        else:
            height = 0
        self.__sizeHint = QSize(width, height)
    return self.__sizeHint
