def METHOD_NAME(self, option, index):
    super_size_hint = super().METHOD_NAME(option, index)
    parent_width = self.parent().width()  # type: ignore
    fm = QFontMetrics(QApplication.font())
    comment = index.data(Qt.UserRole)
    content_width = parent_width - 2 * self._margin_h
    content_height = self._get_text_height(fm, content_width, comment.content)
    height = content_height + self._name_height + \
        self._name_content_margin + self._margin_v * 2
    parent_comment = comment.parent
    if parent_comment is not None:
        p_margins = self._parent_comment_margins
        p_paddings = self._parent_comment_paddings
        text = f'{parent_comment.user_name}：{parent_comment.content}'
        p_height = self._get_text_height(fm, content_width - p_margins.width, text)
        height += p_height + p_margins.height + p_paddings.height
    return QSize(super_size_hint.width(), height)