def METHOD_NAME(self, option):
    option.initFrom(self)
    option.lineWidth = self.style().pixelMetric(
        QStyle.PM_DefaultFrameWidth, option, self
    )
    option.midLineWidth = 0
    option.rect = option.rect.adjusted(*self._margins)
    option.state |= QStyle.State_Sunken
    if self._readOnly:
        option.state |= QStyle.State_ReadOnly