Using QTWebKit to display a website stored in memory

拥有回忆 提交于 2019-12-05 10:07:22

I think in your case the best solution is to inherit QNetworkReply class and use this new class in reimplemented QNetworkAccessManager::createRequest() function.

In general, you should reimplement next virtual functions of QNetworkReply: bytesAvailable(), readData(char *data, qint64 maxSize), close(), abort().

For example, readData should be the folowing:

qint64 NetworkReplyEx::readData(char *data, qint64 maxSize)
{
    return m_buffer.read(data, maxSize);
}

where m_buffer is already decrypted data.

Also you need to add all necessary logic in this class to get encrypted data, decrypt this data... In the end you should manually emit finished() signal inside new class, so QWebView or other related class will get decrypted html.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!