code: def sizeHint(self, option, index):
          
  
          document = QTextDocument()
          document.setDefaultFont(option.font)
          data = index.model().data(index)
          text = umbra.ui.common.QVariant_to_string(data)
          self.__label.setText(text)
          document.setHtml(text)
          return QSize(document.idealWidth() + self.__indent, option.fontMetrics.height())
docs: Reimplements the :meth:`QStyledItemDelegate.sizeHint` method.