add a new plugins path to Qtwebkit

老子叫甜甜 提交于 2019-12-23 01:07:48

问题


I am trying to extend the search paths that qtwebkit uses to search for plugins. Basically I'm creating a plugin that is designed using the QTBrowserPlugin class and I am trying to make my browser which is programmeed using QTwebKit to search for the plugin in a folder specified by me as I don't want the plugin to be stored in the Mozilla Firefox plugins directory or the standard plugins directories.

Is this possible, and can I make my browser only look in the directory that I've specified, skipping all the standard directories. Since the browser will only be used to view locaL html pages.


回答1:


There does not seem to be a public method in QtWebKit for doing this.

If you're willing to build QtWebKit from source, you can add a method to QWebPage that calls PluginDatabase::setPluginDirectories() and PluginDatabase::refresh().




回答2:


I believe you can set the environment variable QTWEBKIT_PLUGIN_PATH for this purpose.



来源:https://stackoverflow.com/questions/2139983/add-a-new-plugins-path-to-qtwebkit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!