QML WebView load page from cache

  • Hello, it is possible to load page from cache using QML WebView? If there is an Internet connection I want to load page from Internet and if there is no - load page from cache.

  • You can set..
    or open html file like epub file..
    Save local html page is also possibel..

    EpubView::EpubView(QWidget *parent) : QWebEngineView(parent) {
      modusNow = 1;
      this->setContentsMargins(0, 0, 0, 0);
      connect(QWebEngineView::page(), SIGNAL(loadFinished(bool)), this, SLOT(startHtmlGrab(bool)));
    void EpubView::startHtmlGrab( bool ok) {
         if (ok) {
             QUrl uri = this->page()->url();
             if (uri.isLocalFile()) {
                connect(this, SIGNAL(incomHtml(QString)), this, SLOT(handleHTML(QString)));
                this->page()->toHtml([this](const QString& result) mutable { emit (void)incomHtml(result);});


    Oh sorry i dont see QML.....
    QML -> https://doc.qt.io/qt-5/qml-qtwebengine-webengineprofile.html#httpCacheMaximumSize-prop

  • According (QtWebEngine 1.5) property cachePath path to cache by default is StandardPaths.writableLocation(StandardPaths.CacheLocation). Where are some files in that folder and none of them has extention .html (Some files has some JavaScript functions, others css and html tags inside). Is there any way to some how glue them to one page and display by using WebView component (QML)?


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.