开发者

Qwebkit and flash player,why its not working in windows

im using Qwebkit and every time im loading youtube , its asking me to download the latest

flash play开发者_StackOverflow中文版er plugin , even so i already installed the plugin and i can see youtube videos

in firefox and explorer very well

what is the deal with Qwebkit and Flash plagin ?


There is a way of doing it. Qt in windows doesn't use by default the flash plugin even if you have installed it for firefox. The solution is to manually copy the plugin dll into your compiled application directory (I mean in the same directory than the executable is installed).

I did it more than a year ago so I'm not totally sure if it has to be directly in the directory or under a folder called plugins. Try both and one of them should work.

The flash plugin dll should be in your firefox directory, if not do a search in google and there are several pages in which you can download it.

You also need to activate plug-ins support for QWebView. I think that was done in the pro file, but I have been doing some research and it maybe done changing the web settings:

    websettings.setAttribute(QtWebKit.QWebSettings.PluginsEnabled,True)


Go to adobe.com and download the plugin for Other Browsers (Firefox, Safari, Opera), and re-install...


Just to report on my experience of enabling flash in QWebKit, do the following:

download firefox and install flash player for firefox, enable plug-ins in QWebKit (QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);) then recompile your Qt Application. Now flash should work fine.


Your problem is very simple to solve. Just add the following lines to your code:

QWebSettings *defaultSettings = QWebSettings::globalSettings();
defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜