It can be done, but it is not exactly a walk in a park.
The webkit uses QNetworkAccessManager and QNetworkReply internally to download resources like html-pages, images, etc.. from web. What you need to do is to provide your own network reply object to webkit which "downloads" data from the in-memory location.
So, first derive a new class from QNetworkReply and reimplement it so that it returns data from the in-memory location. Also, remember that webkit will expect the returned data to be a HTML-response, with all the correct HTTP-headers included.
Then derive a new class from QNetworkAccessManager and reimplement its method QNetworkReply *createRequest( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 ). Inside that factory method you can create and initialize an object from your network reply class and then return it to caller.
Finally, QWebPage has setNetworkAccessManager() method which you can then use to pass your own network access manager to it.
Bookmarks