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

Method __init__

Demo/RestartWindow.py:27–37  ·  view source on GitHub ↗
(self, path, *args, **kwargs)

Source from the content-addressed store, hash-verified

25 _Self = None # 很重要,保留窗口引用
26
27 def __init__(self, path, *args, **kwargs):
28 super(RestartWindow, self).__init__(*args, **kwargs)
29 RestartWindow._Self = self
30 layout = QVBoxLayout(self)
31 layout.addWidget(QLabel("当前工作目录:" + path, self))
32 self.dirEdit = QLineEdit(
33 self, placeholderText="请输入要切换的目录", returnPressed=self.onChangeDir)
34 layout.addWidget(self.dirEdit)
35 layout.addWidget(QPushButton(
36 "点我切换工作目录", self, clicked=self.onChangeDir))
37 self.restarted.connect(RestartWindow.onRestart)
38
39 def onChangeDir(self):
40 path = self.dirEdit.text().strip()

Callers

nothing calls this directly

Calls 1

addWidgetMethod · 0.80

Tested by

no test coverage detected