Important: Please read the Qt Code of Conduct -

QWebEngineView - problem with loading big files

  • Hi,
    i am trying to solve problem, with loading big HTML files via QWebEngineView.
    HTML contains tables with data, and its larger than 1MB, pure HTML.

    My code:

    page= new QWebEnginePage( ui->webEngineView);
    ui->webEngineView->setPage( page);
    QFile f(fileName);
      if ( {
        QByteArray b = f.readAll(); // all read, data are present
        QString s = a;  // conversion to string is OK
        page->setHtml( s); // HTML is shown correctly, when data are about 750kB, when tried to load 1.5MB, or bigger files, it failed without any error

    I used this with legacy QWebView, and it worked, it was slow, but worked. Any guess, how to solve it?

    Thanks, Martin

  • setHtml(s) isn't suitable for big pages, because it converts passed data into Url of data: scheme, so easily can reach Url length limit. Why not use load(url) function to display such a file? For example:


Log in to reply