How to tell QWebPage not to load specific type of resources?
问题 How to tell QWebPage not to load specific type of resources like js, css or png? 回答1: The solution is to extend QNetworkAccessManager class and override it's virtual method QNetworkAccessManager::createRequest In our implementation we check the path of the requested url and if it's the one we don't want to download we create and hand over an empty request instead of the real one. Below is a complete, working example. #include <QApplication> #include <QUrl> #include <QtWebKit/QWebPage>