MCPcopy Create free account
hub / github.com/PyQt5/PyQt / BusyWindow

Class BusyWindow

QSplashScreen/GifSplashScreen.py:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41class BusyWindow(QWidget):
42
43 def __init__(self, *args, **kwargs):
44 super(BusyWindow, self).__init__(*args, **kwargs)
45 # 模拟耗时操作,一般来说耗时的加载数据应该放到线程
46 for i in range(5):
47 sleep(1)
48 splash.showMessage('加载进度: %d' % i, Qt.AlignHCenter | Qt.AlignBottom, Qt.white)
49 QApplication.instance().processEvents()
50
51 splash.showMessage('初始化完成', Qt.AlignHCenter | Qt.AlignBottom, Qt.white)
52 splash.finish(self)
53
54
55if __name__ == '__main__':

Callers 1

GifSplashScreen.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected