PDA

View Full Version : QWebView too slow



URPradhan
27th November 2009, 07:03
I'm writing a sample Qt application and using QWebView for a tiny custom browser.
But till now I found 2 major issues with QWebView, like ...

1. Its too slow to display the url using QWebView as compared to web browser (ex: Firefox)
2. QWebView is not rendering Flash movies

So, want to know why QWebView is slow as compared to Firefox.

Thank you.

wysota
27th November 2009, 08:49
In general WebKit tends to be faster than Firefox, so this is probably some configuration issue on your system. Flash should work as well, provided you have an ns-plugin for it installed. If you can see flash in Firefox, it means you do - whether WebKit can find it, that's a different issue. See the docs for QtWebKit about support for netscape plugins.

Edit: here is an example code that works for me:

#include <QtGui>
#include <QtWebKit>


int main(int argc, char **argv){
QApplication app(argc, argv);
QWebView wv;
QWebPage *page = wv.page();
QWebSettings *settings = page->settings();
settings->setAttribute(QWebSettings::JavascriptEnabled, true);
settings->setAttribute(QWebSettings::PluginsEnabled, true);
wv.load(QUrl("http://www.youtube.com"));
wv.show();
return app.exec();
}

jay
22nd December 2009, 11:01
Hi

I have done my first sample in QtWebkit with the help of your below code.Thank you.
I am able to run any URL using this.

When I try to run the below URL in Firefox (MAC OS), it is played with the help of Flip4Mac plugin.
http://www.researchchannel.org/webcast/asx/rtv-high.asx
The QWebView cannot play this URL, and the debugger shows the below error.
Error loading /Library/Internet Plug-Ins/DRM Plugin.bundle/Contents/MacOS/DRM Plugin: dlopen(/Library/Internet Plug-Ins/DRM Plugin.bundle/Contents/MacOS/DRM Plugin, 262): no suitable image found. Did find:
/Library/Internet Plug-Ins/DRM Plugin.bundle/Contents/MacOS/DRM Plugin: unknown file type, first eight bytes: 0x4A 0x6F 0x79 0x21 0x70 0x65 0x66 0x66
Debugger() was called!

Is this error in QtWebkit.

Regards,
Jay.

jay
26th December 2009, 12:34
Is anyone having idea on this?

Regards,
Jay.

lamosca
2nd March 2010, 13:45
hi,

@wysota, when you says "so this is probably some configuration issue on your system." could you tell me what kind of configuration is intended to work the best?

I compiled qt with webkit for windowsCE, and I have poor Javascript performances. Any ideas??

Regards,

wysota
2nd March 2010, 15:46
I have posted that sentence over three months ago so I don't remember what I meant exactly.

How did you measure javascript performance?

thkatsou
22nd March 2012, 19:25
In general WebKit tends to be faster than Firefox, so this is probably some configuration issue on your system. Flash should work as well, provided you have an ns-plugin for it installed. If you can see flash in Firefox, it means you do - whether WebKit can find it, that's a different issue. See the docs for QtWebKit about support for netscape plugins.

Edit: here is an example code that works for me:

#include <QtGui>
#include <QtWebKit>


int main(int argc, char **argv){
QApplication app(argc, argv);
QWebView wv;
QWebPage *page = wv.page();
QWebSettings *settings = page->settings();
settings->setAttribute(QWebSettings::JavascriptEnabled, true);
settings->setAttribute(QWebSettings::PluginsEnabled, true);
wv.load(QUrl("http://www.youtube.com"));
wv.show();
return app.exec();
}


can Confirm very slow javascript dom with pyqt4 , qwebview
I ve heard that webkit is very fast and google chrome runs very well on my system, dell latitude D830 ,MEPIS 11KDE pyqt 4.7.1
But a very simple widget that displays a slideshow with fade out / in transitions , runs very slowly

ChrisW67
22nd March 2012, 23:20
Thanks you for your observations.

Was there a purpose to resurrecting this 2+ year old thread?

thkatsou
23rd March 2012, 08:20
Thanks you for your observations.

Was there a purpose to resurrecting this 2+ year old thread?

What do u mean?

Yes there is a purpose: Qwebview STILL performs slow on some tasks..
Some more observations:
Qwebview runs ok when image transitions are made on the background image of a div , very common practice for image galleries..

Qwebview does not perform well when transitions are made on the img tag example

wysota
23rd March 2012, 12:13
The URL you provided works fine for me in QWebView with Qt 4.7. I suggest you do some more testing next time before you spam a forum with your claims that something doesn't work as it should.