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

Method restore

Demo/EmbedWindow.py:87–101  ·  view source on GitHub ↗

归还窗口

(self)

Source from the content-addressed store, hash-verified

85 win32gui.SetParent(hwnd, int(self.winId()))
86
87 def restore(self):
88 """归还窗口"""
89 # 有bug,归还后窗口没有了WS_VISIBLE样式,不可见
90 widget = self.layout().itemAt(4).widget()
91 hwnd, phwnd, style, exstyle, wrect = widget.hwnd, widget.phwnd, widget.style, widget.exstyle, widget.wrect
92 print('restore', hwnd, phwnd, style, exstyle, wrect)
93 widget.close()
94 self.layout().removeWidget(widget) # 从布局中移出
95 widget.deleteLater()
96
97 win32gui.SetParent(hwnd, phwnd) # 让它返回它的父窗口
98 win32gui.SetWindowLong(hwnd, win32con.GWL_STYLE, style | win32con.WS_VISIBLE) # 恢复样式
99 win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, exstyle) # 恢复样式
100 win32gui.ShowWindow(hwnd, win32con.SW_SHOW) # 显示窗口
101 win32gui.SetWindowPos(hwnd, 0, wrect[0], wrect[1], wrect[2], wrect[3], win32con.SWP_NOACTIVATE)
102
103 def _enumWindows(self, hwnd, _):
104 """遍历回调函数"""

Callers 14

releaseWidgetMethod · 0.95
animateMethod · 0.80
paintEventMethod · 0.80
paintEventMethod · 0.80
html2canvas.min.jsFile · 0.80
html2canvas.min.jsFile · 0.80
drawControlMethod · 0.80
drawCircleMethod · 0.80
paintEventMethod · 0.80
_drawCircleMethod · 0.80
_drawArcMethod · 0.80
_drawTextMethod · 0.80

Calls 2

itemAtMethod · 0.80
deleteLaterMethod · 0.80

Tested by

no test coverage detected