提交 9707786e 编写于 作者: 之一Yo's avatar 之一Yo

Merge branch 'master' into PyQt5

......@@ -138,7 +138,7 @@ class ProgressBar(QProgressBar):
class IndeterminateProgressBar(QProgressBar):
""" Indeterminate progress bar """
def __init__(self, parent=None):
def __init__(self, parent=None, start=True):
super().__init__(parent=parent)
self._shortPos = 0
self._longPos = 0
......@@ -166,6 +166,9 @@ class IndeterminateProgressBar(QProgressBar):
self.setFixedHeight(4)
if start:
self.start()
@pyqtProperty(float)
def shortPos(self):
return self._shortPos
......@@ -184,16 +187,21 @@ class IndeterminateProgressBar(QProgressBar):
self._longPos = p
self.update()
def showEvent(self, e):
super().showEvent(e)
self.start()
def start(self):
self.shortPos = 0
self.longPos = 0
self.aniGroup.start()
self.update()
def stop(self):
self.aniGroup.stop()
self.shortPos = 0
self.longPos = 0
self.update()
def isStarted(self):
return self.aniGroup.state() == QParallelAnimationGroup.Running
def pause(self):
self.aniGroup.pause()
self.update()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册