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

Class Window

Demo/AutoRestart.py:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29class Window(QWidget):
30
31 def __init__(self, *args, **kwargs):
32 super(Window, self).__init__(*args, **kwargs)
33 self.resize(400, 400)
34 layout = QHBoxLayout(self)
35
36 self.buttonRestart = QPushButton(
37 "app start...%s...twice\napp pid: %s\n点击按钮重启...\n" %
38 (options.twice, os.getpid()), self)
39 self.buttonRestart.clicked.connect(self.close)
40
41 self.buttonExit = QPushButton('退出', self, clicked=self.doExit)
42
43 layout.addWidget(self.buttonRestart)
44 layout.addWidget(self.buttonExit)
45
46 def doExit(self):
47 global canRestart
48 canRestart = False
49 self.close()
50
51
52if __name__ == "__main__":

Callers 1

AutoRestart.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected