I\'m working on a touch screen app where gui space is very tight. I\'d like to rotate a QLabel a bit so that it\'s either vertical, or offset at a diagonal a bit. Any sugg
Answer from @Controlix is a generic implementation, however, I was getting a "recursive painting call" warning. I was able to address that by combining approaches from @Controlix and @Ivo. Here is my implementation:
from PyQt5.Qt import QLabel
from PyQt5 import QtGui
class VerticalLabel(QLabel):
def __init__(self, *args):
QLabel.__init__(self, *args)
def paintEvent(self, event):
painter = QtGui.QPainter(self)
painter.translate(0, self.height())
painter.rotate(-90)
painter.drawText(0, self.width()/2, self.text())
painter.end()