[webkit-qt] pass memroy data to QNetworkReply

周鹏 zhoupeng19 at 126.com
Tue Mar 22 01:28:39 PDT 2011


Hi,all! 

    In my program, i have download some type of resource(such as js file,imgs) in memory,so, i don't need QNetworkAccessManager to download some external resource. I hava extend QNetworkAccessManager class and override it's virtual method QNetworkAccessManager::createRequest,but i don't know how to pass memory data to QNetworkReply,can anyone help me?

virtual QNetworkReply * createRequest(Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0) 
{
    if (req.url().path().endsWith("js")) 
    {
        //TODO
        //all js file has download in memory(not in file),so, how to fabricate a QNetworkReply using memory data
    } 
    else 
    {
        return QNetworkAccessManager::createRequest(op, req, outgoingData);
    }
}

        Zhou Peng 
        zhoupeng19 at 126.com 
          2011-03-22 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110322/6e70ae6e/attachment.html>


More information about the webkit-qt mailing list