I'm somewhat new to Qt and was wondering how to rotate a Label that has a pixmap inside of it. I've tried somethings like this:
def paintEvent (self, event): t = QtGui.QTransform() image = QtGui.QImage(_fromUtf8(":/icons/BOOM_OUT.png")) pixmap = QtGui.QPixmap.fromImage(image) self.label.setPixmap(pixmap) t.translate(400,300) t.rotate(45) p = QtGui.QPainter(self) p.setTransform(t) p.drawPixmap((-pixmap.width()/2),(-pixmap.height()/2), pixmap) p.end()
I know that the drawPixmap doesn't reference the label, but I cannot get this to work. I feel like this should be easy, but from everything I have read it seems somewhat difficult. Any help would be greatly appreciated!