如何为 QtWebKit 开发插件?
我正在尝试为 QtWebkit 开发插件。 但我无法找到如何为 QtWebKit 开发一个插件,希望它可以由 JavaScript 调用。 有谁知道有任何教程或文档解释如何执行此操作?
Webkit已经集成到Qt中,这个集成包称为QtWebkit。 他们提供了创建插件的新方法。
-问候,维韦克·古普塔
I am trying to develop a plug-in for QtWebkit. But I am not able to find how to develop a plugin for QtWebKit, hopefully one that can be invoked by JavaScript. Does anyone know of any tutorials or documents that explain how to do this?
Webkit has been intregated into Qt and this integrated package is called QtWebkit. They have provided new method for for plugin creation.
-Regards, Vivek Gupta
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
简单的答案是编写
QWebPage
的子类并将其设置在您的webview
上。 然后,您可以显示自己的 HTML 页面并对 < 中的适当对象标记做出反应代码>createPlugin方法;并显示类似以下 HTML 的内容;
请记住,如果您想要
QWebSettings
要拥有更高级的功能,您应该使用
QWebPluginFactory
The simple answer is to write a subclass of
QWebPage
and set this on yourwebview
. Then you can show your own HTML page and react to the appropriate object tag in thecreatePlugin
method;and show something like the following HTML;
Remember you need to turn on plugins, and possibly also JavaScript if you want more advanced functionality in the
QWebSettings
To have more advanced functionality, you should use a
QWebPluginFactory
实际上Qt中已经集成了Webkit,这个集成的包称为QtWebkit。
他们提供了创建插件的新方法。我只需要一个在 QtWebkit 中创建插件的链接或步骤,并且该插件应该由 java 脚本调用。
问候
维韦克·古普塔
Actually Webkit has been intregated in Qt and this intregated package is called QtWebkit.
And they have provided new method for for plugin creation.I just need a link or steps for creating a plugin in QtWebkit and that plugin should be invoked by java script.
Regards
Vivek Gupta
WebKit 插件编程主题简介适用于 WebKit, QtWebKit 有那么特别吗?
Introduction to WebKit Plug-in Programming Topics is for WebKit, is QtWebKit that special?
要将对象公开给 Javascript,请使用
其中
lineedit
是可用于从 javascript 访问对象的名称。Qt属性将公开为 JavaScript 属性,插槽将公开为 JavaScript 方法。
(参见http://doc.qt.io/archives/qt-4.7 /qwebframe.html#addToJavaScriptWindowObject)
To expose the object to Javascript, use
where
lineedit
is the name that can be used to access the object from javascriptQt properties will be exposed as JavaScript properties and slots as JavaScript methods.
(see http://doc.qt.io/archives/qt-4.7/qwebframe.html#addToJavaScriptWindowObject)