def METHOD_NAME(self):
    if self.type._arch is None:
        raise TypeError("Must provide SimTypes with arches to QTypeDef")
    self.text = f"typedef {self.type.type.c_repr(name=self.type.name, full=1)};"
    self.lines = self.text.split("\n")
    fields = None
    offsets = None
    for i, line in enumerate(self.lines):
        type_size = self.type.size if not isinstance(self.type.type, SimTypeBottom) else 0
        if i == 0:
            prefix = f"{type_size // self.type._arch.byte_width:08x}"
        elif isinstance(self.type.type, SimUnion):
            prefix = "00000000"
        elif isinstance(self.type.type, SimStruct):
            fieldno = i - 1
            if fields is None:
                fields = list(self.type.type.fields)
                offsets = self.type.type.offsets
            if fieldno < len(fields):
                prefix = f"{offsets[fields[fieldno]]:08x}"
            else:
                prefix = f"{type_size // self.type._arch.byte_width:08x}"
        else:
            raise TypeError("I don't know why a %s renders with more than one line" % type(self.type.type))
        self.lines[i] = f"{prefix}  {line}"
    self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
    height = len(self.lines) * LINE_HEIGHT + LINE_HEIGHT // 2
    self.setMinimumHeight(height)
    self.setMaximumHeight(height)
    self.setMinimumWidth(max(len(line) for line in self.lines) * COL_WIDTH)
    self.repaint()