MCPcopy
hub / github.com/PyQt5/PyQt / __init__

Method __init__

QWebEngineView/JsSignals.py:30–40  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

28 customSignal = pyqtSignal(str)
29
30 def __init__(self, *args, **kwargs):
31 super(WebEngineView, self).__init__(*args, **kwargs)
32 self.initSettings()
33 self.channel = QWebChannel(self)
34 # 把自身对象传递进去
35 self.channel.registerObject('Bridge', self)
36 # 设置交互接口
37 self.page().setWebChannel(self.channel)
38
39 # START #####以下代码可能是在5.6 QWebEngineView刚出来时的bug,必须在每次加载页面的时候手动注入
40 #### 也有可能是跳转页面后就失效了,需要手动注入,有没有修复具体未测试
41
42 # self.page().loadStarted.connect(self.onLoadStart)
43 # self._script = open('Data/qwebchannel.js', 'rb').read().decode()

Callers

nothing calls this directly

Calls 4

initSettingsMethod · 0.95
registerObjectMethod · 0.80
QWebChannelFunction · 0.50
__init__Method · 0.45

Tested by

no test coverage detected