Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngineView - problem with loading big files
Forum Updated to NodeBB v4.3 + New Features

QWebEngineView - problem with loading big files

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • KulisekK Offline
    KulisekK Offline
    Kulisek
    wrote on last edited by
    #1

    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 ( f.open(QIODevice::ReadOnly)) {
                
        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

    1 Reply Last reply
    0
    • RimasMR Offline
      RimasMR Offline
      RimasM
      wrote on last edited by
      #2

      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:

      page->load(QUrl::fromLocalFile(fileName));
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved