2020
10-23
10-23
如何让PyQt5中QWebEngineView与JavaScript交互
准备工作开发环境Python3.8.1Windows10安装依赖pipinstallPyQt5pipinstallPyQtWebEnginePython端1.使用QWebChannel的registerObject("JsBridge名","JsBridge")方法注册回调JsBridge名:在JavaScript中调用时使用的对象名称JsBridge:被JavaScript调用的Python对象2.JsBridge对象入参@QtCore.pyqtSlot(str)deflog(self,message):print(message)出参@QtCore.pyqtSlot(result=str)defgetName(self):r...
继续阅读 >