Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. [Qt 5.2] Improving QWebView performance with large amount of data?
QtWS25 Last Chance

[Qt 5.2] Improving QWebView performance with large amount of data?

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 1.2k 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.
  • M Offline
    M Offline
    Morgen
    wrote on last edited by
    #1

    I am using QWebView to display a large amount of, continuously growing data. Using QWebElement::appendInside to add more data to the page as needed.Nothing fancy to the HTML, no javascript or images just some basic CSS. I have disabled javscript using QWebSettings. About 600k lines would be the be highest possible total, although generally its only at 50k.

    I could be adding up to 100 lines every 200 msec. I batch the HTML I want to add to the page together in a single QString before calling QWebElement::appendInside, but it's still slow. Even after I stop updating the page, when I have a large amount of data in it lags to scroll through it or atleast maxes out the thread.

    I'm not particularly tied to using WebKit if someone can suggest a totally different but faster way of displaying the data.

    @const int numRecords = _RecordsQueue.size() - 1;

    QWebElement element = ui.LogText->page()->mainFrame()->documentElement().findFirst("body");
    QString html;
    html.reserve(325 * (numRecords + 1));
    for(int i=0; i<=numRecords; i++)
    {
    const QString msg = _ToString->ToString(_RecordsQueue.at(i), _CurrentEncounterID);
    if (!msg.isEmpty())
    {
    html.append("<p>" % msg % "<p>");
    }
    }
    _RecordsQueue.clear();

    if (!html.isEmpty())
    {
    html.squeeze();
    element.appendInside(html);

    if (!_ScrollTimer->isActive())
    {
    _ScrollTimer->start();
    }
    }@

    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