在QT 5.10上未识别出新QT 5.10上的JavascriptWindowObjectCleared()的JavaS
what is the alternative of javaScriptWindowObjectCleared() on new qt 5.10 ?javaScriptWindowObjectCleared is not recognized on qt 5.10
请帮助我要将webkit移植到WebEngine,但我有一些问题,我有一个信号JavascriptWindowObjectCleared((,这是New QT 5.10未识别的。在这种情况下,什么可以帮助我?
connect( this->page(), SIGNAL( javaScriptWindowObjectCleared() ), SLOT( OnPopulateJavaScriptObjec() ) );
以下代码sinppet可能会为您提供帮助。
QWebEngineScript toBeInjectedjs;
toBeInjectedjs.setName("qwebchannel.js");
toBeInjectedjs.setInjectionPoint(QWebEngineScript::DocumentCreation); //important
toBeInjectedjs.setRunsOnSubFrames(false);
toBeInjectedjs.setWorldId(QWebEngineScript::MainWorld);
toBeInjectedjs.setSourceCode(jsStr); //jsStr is what your want to inject to page;
scripts().insert(toBeInjectedjs); //scripts is a member function of QWebEnginePage.
相关文章:
- Qt VTK交互风格的信号到小部件
- QT在错误的班级中寻找空位
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 如何在Qt窗口小部件中使用QStringView(或QStringRef)
- 如何在Qt C++中更改光标
- 如何在MS Visual Studio 2019中运行QT UI
- QT通过C++添加映射QML项目
- libssh 的函数在构建 libssh 时无法在 Qt 和 cmake 错误中找到
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用Qt C++计算类似Git的SHA1哈希
- Qt focusObjectChanged example?
- 如何在cpp文件之间切换窗口?在Qt中
- Qt和C++:将QLineEdit添加到QTabWidget中
- 从数据库实时显示QT c++中的数据
- Qt Quick-如何仅从c++代码与qml属性交互
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 如何在Qt中取消捕获字符串
- Qt SQLite没有查询或参数计数不匹配
- Qt SQlite无法创建表