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

Class LoadingThread

QPushButton/BottomLineProgress.py:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35class LoadingThread(QThread):
36 valueChanged = pyqtSignal(float) # 当前值/最大值
37
38 def __init__(self, *args, **kwargs):
39 super(LoadingThread, self).__init__(*args, **kwargs)
40 self.totalValue = randint(100, 200) # 模拟最大
41
42 def run(self):
43 for i in range(self.totalValue + 1):
44 if self.isInterruptionRequested():
45 break
46 self.valueChanged.emit(i / self.totalValue)
47 QThread.msleep(randint(50, 100))
48
49
50class PushButtonLine(QPushButton):

Callers 1

startMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected