So hey Im completely new to QT, and hopefully this is an obvious problem.

What Im trying to do is cache my webpages and retrieve them from the cache. Caching itself seems to works ok - meaning .cache files are created everytime I load a webpage.

However Im not sure how to go about loading from the cache, any ideas?

Qt Code:
  1. manager = new QNetworkAccessManager();
  2. diskCache = new QNetworkDiskCache();
  3.  
  4. QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
  5. diskCache->setCacheDirectory(location);
  6. manager->setCache(diskCache);
  7. ui->webView->page()->setNetworkAccessManager(manager);
  8. ui->webView->page()->settings()->setMaximumPagesInCache(10);
  9.  
  10. request = QNetworkRequest();
  11. request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysCache);
  12. request.setUrl(QUrl("http://www.qtcentre.org"));
  13.  
  14. ui->webView->load(request);
To copy to clipboard, switch view to plain text mode 

Any help would be appreciated.