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

Method __init__

Demo/EmbedWindow.py:30–44  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

28class Window(QWidget):
29
30 def __init__(self, *args, **kwargs):
31 super(Window, self).__init__(*args, **kwargs)
32 self.resize(800, 600)
33 layout = QVBoxLayout(self)
34
35 self.myhwnd = int(self.winId()) # 自己的句柄
36
37 layout.addWidget(QPushButton('获取所有可用、可视窗口', self,
38 clicked=self._getWindowList, maximumHeight=30))
39 layout.addWidget(QPushButton('释放窗口', clicked=self.releaseWidget, maximumHeight=30))
40 layout.addWidget(
41 QLabel('双击列表中的项目则进行嵌入目标窗口到下方\n格式为:句柄|父句柄|标题|类名', self, maximumHeight=30))
42 self.windowList = QListWidget(
43 self, itemDoubleClicked=self.onItemDoubleClicked, maximumHeight=200)
44 layout.addWidget(self.windowList)
45
46 def releaseWidget(self):
47 """释放窗口"""

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.95
addWidgetMethod · 0.80

Tested by

no test coverage detected