eric6/E5Gui/E5AnimatedLabel.py

changeset 8218
7c09585bd960
parent 7923
91e843545d9a
equal deleted inserted replaced
8217:385f60c94548 8218:7c09585bd960
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 ))
175 175
176 @param pixmap pixmap to be set 176 @param pixmap pixmap to be set
177 @type QPixmap 177 @type QPixmap
178 """ 178 """
179 self.stop() 179 self.stop()
180 super(E5AnimatedLabel, self).setPixmap(pixmap) 180 super().setPixmap(pixmap)

eric ide

mercurial