def METHOD_NAME(self, event):
    p = QStylePainter(self)
    p.rotate(90)
    p.translate(0, - self.width())
    opt = QStyleOptionButton()
    opt.initFrom(self)
    opt.text = self.text()
    if self.isChecked():
        opt.state |= QStyle.State_On
    s = opt.rect.size().transposed()
    opt.rect.setSize(s)
    p.drawControl(QStyle.CE_PushButton, opt)