[Qt-interest] Loading resources in WebView? (WebKit)

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Fri Apr 3 01:30:56 CEST 2009


Hi Stefan, 
 
Please reply to the list, not just myself. 
 
I had the same problem, and simply overrode all of the virtual methods with
debug tracing.  It was the bytesAvailable that was required, as well as open
and readData. 
 
Tony.

-----Original Message-----
From: Stefan.Aberg at nokia.com [mailto:Stefan.Aberg at nokia.com] 
Sent: Thursday, 2 April 2009 22:08
To: tony.rietwyk at rightsoft.com.au
Subject: RE: [Qt-interest] Loading resources in WebView? (WebKit)


 
Hi Tony,
 
Thanks for your answer. I got it almost working now but I still don't know
what methods to override in QNetworkReply to return the actual data in. I
assume it's one of the methods in QIODevice that QNetworkReply inherits from
but none of the read methods I've tried gets called. How are you actually
returning the content that you're reading from the database in
QNetworkReply?
 
Stefan
 


  _____  

From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ext Tony Rietwyk
Sent: 24 March, 2009 01:54
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Loading resources in WebView? (WebKit)


Hi Stefan, 
 
Webkit is much more complicated, because resource requests are pipelined
using signals/slots.  I achieved a similar result by:
 
- overiding QNetworkReply to read content from a database. 
- you must NOT signal the finished/error in the reply constructor - use a
singleshot 0 timer to signal it later - so clients can connect to the
signals. 
- overiding QNetworkAccessManager.createRequest to check for protocol "qdb:"
and returning the network reply from above. 
- pass the manager object to QWebPage.setNetworkAccessManager.
 
It works quite well. 
 
Hope that helps, 
 
Tony Rietwyk
 
 


Hi,
 
I'm using QTextBrowser to display some html mail messages. I inherit a class
from it and redefine
virtual QVariant loadResource ( int type, const QUrl & name )
to load the inline images from the email ala <img
src="cid:131095406 at 01122008-1CBD"> which are in a different part of the
message.
 
Now I'd like to use WebView instead of QTextBrowser but I can't find any
method that could be used for this purpose. 
 
Any ideas?
 
Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090403/e6cd7681/attachment.html 


More information about the Qt-interest-old mailing list