eric6/E5Gui/E5AnimatedWidget.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
59 @pyqtSlot() 59 @pyqtSlot()
60 def startAnimation(self): 60 def startAnimation(self):
61 """ 61 """
62 Public slot to start the animation. 62 Public slot to start the animation.
63 """ 63 """
64 if self.__timeline.state() == QTimeLine.Running: 64 if self.__timeline.state() == QTimeLine.State.Running:
65 return 65 return
66 66
67 shown = 0 67 shown = 0
68 hidden = 0 68 hidden = 0
69 69
75 75
76 self.__stepY = (hidden - shown) / 100.0 76 self.__stepY = (hidden - shown) / 100.0
77 self.__startY = hidden 77 self.__startY = hidden
78 self.__stepHeight = self.__widget.height() / 100.0 78 self.__stepHeight = self.__widget.height() / 100.0
79 79
80 self.__timeline.setDirection(QTimeLine.Forward) 80 self.__timeline.setDirection(QTimeLine.Direction.Forward)
81 self.__timeline.start() 81 self.__timeline.start()
82 82
83 @pyqtSlot(int) 83 @pyqtSlot(int)
84 def __animateFrame(self, frame): 84 def __animateFrame(self, frame):
85 """ 85 """
95 @pyqtSlot() 95 @pyqtSlot()
96 def hide(self): 96 def hide(self):
97 """ 97 """
98 Public slot to hide the animated widget. 98 Public slot to hide the animated widget.
99 """ 99 """
100 if self.__timeline.state() == QTimeLine.Running: 100 if self.__timeline.state() == QTimeLine.State.Running:
101 return 101 return
102 102
103 self.__timeline.setDirection(QTimeLine.Backward) 103 self.__timeline.setDirection(QTimeLine.Direction.Backward)
104 self.__timeline.finished.connect(self.close) 104 self.__timeline.finished.connect(self.close)
105 self.__timeline.start() 105 self.__timeline.start()
106 106
107 p = self.parentWidget() 107 p = self.parentWidget()
108 if p is not None: 108 if p is not None:

eric ide

mercurial