27 @keyparam animationFile path to the file containing the animation data |
27 @keyparam animationFile path to the file containing the animation data |
28 @type str |
28 @type str |
29 @keyparam interval interval in milliseconds between animation frames |
29 @keyparam interval interval in milliseconds between animation frames |
30 @type int |
30 @type int |
31 """ |
31 """ |
32 super(E5AnimatedLabel, self).__init__(parent) |
32 super().__init__(parent) |
33 |
33 |
34 self.__timer = QTimer(self) |
34 self.__timer = QTimer(self) |
35 self.__timer.setInterval(interval) |
35 self.__timer.setInterval(interval) |
36 self.__timer.timeout.connect(self.__animate) |
36 self.__timer.timeout.connect(self.__animate) |
37 |
37 |
73 """ |
73 """ |
74 Private slot to animate the pixmap. |
74 Private slot to animate the pixmap. |
75 """ |
75 """ |
76 if self.__animationFileLoaded: |
76 if self.__animationFileLoaded: |
77 self.__currentFrame = (self.__currentFrame + 1) % self.__frames |
77 self.__currentFrame = (self.__currentFrame + 1) % self.__frames |
78 super(E5AnimatedLabel, self).setPixmap(self.__pixmap.copy( |
78 super().setPixmap(self.__pixmap.copy( |
79 self.__currentFrame * self.__pixmapHeight, |
79 self.__currentFrame * self.__pixmapHeight, |
80 0, |
80 0, |
81 self.__pixmapHeight, |
81 self.__pixmapHeight, |
82 self.__pixmapHeight |
82 self.__pixmapHeight |
83 )) |
83 )) |