问题
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