(self, *args, **kwargs)
| 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() |
nothing calls this directly
no test coverage detected