Exemple #1
0
 def sizeHint(self):
     hint = QLabel.sizeHint(self)
     width, height = hint.width(), hint.height()
     angle = self.angle * pi / 180
     rotated_width = abs(width * cos(angle)) + abs(height * sin(angle))
     rotated_height = abs(width * sin(angle)) + abs(height * cos(angle))
     return QSize(rotated_width, rotated_height)
Exemple #2
0
 def sizeHint(self):
     hint = QLabel.sizeHint(self)
     width, height = hint.width(), hint.height()
     angle = self.angle*pi/180
     rotated_width = abs(width*cos(angle))+abs(height*sin(angle))
     rotated_height = abs(width*sin(angle))+abs(height*cos(angle))
     return QSize(rotated_width, rotated_height)