Reputation: 93
I'm porting a program from QWebKit to QWebEngine, and it had an offline mode. Users were able to download some files. And if these files are downloaded, they can be viewed and accessed from offline mode. But QWebEngine just shows "No internet connection" page. Is there any way to fix this, since I'be heard that QWebEngine uses Chromium and there's no dirrect way to manipulate cache
Upvotes: 0
Views: 990
Reputation: 98425
The QtWebEngineCore
module doesn't expose it - and for a good reason. There's no way to guarantee that it'd work, because merely opening a page in the browser doesn't guarantee that everything needed to show it next time will load. There's also no guarantee that the items in the cache have necessary time-to-live and won't be stale and flushed the next time you attempt to use the cache.
You must cache the pages yourself, and the pages must have been designed to be cacheable like that, and point the browser to a file:///
URL of your cache. If you think of caching random web content that way: forget it, it's not going to work. It didn't work in WebKit either, it just pretended to, but things would be subtly broken.
Upvotes: 1