MCPcopy Index your code
hub / github.com/PyQt5/PyQt / ProgressBar

Class ProgressBar

QProgressBar/SimpleStyle.py:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55
56class ProgressBar(QProgressBar):
57
58 def __init__(self, *args, **kwargs):
59 super(ProgressBar, self).__init__(*args, **kwargs)
60 self.setValue(0)
61 if self.minimum() != self.maximum():
62 self.timer = QTimer(self, timeout=self.onTimeout)
63 self.timer.start(randint(1, 3) * 1000)
64
65 def onTimeout(self):
66 if self.value() >= 100:
67 self.timer.stop()
68 self.timer.deleteLater()
69 del self.timer
70 return
71 self.setValue(self.value() + 1)
72
73
74class Window(QWidget):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected