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. Show progress of html loading for QTextEdit
QtWS25 Last Chance

Show progress of html loading for QTextEdit

Scheduled Pinned Locked Moved General and Desktop
3 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.
  • A Offline
    A Offline
    angeFran
    wrote on last edited by
    #1

    Hi everybody,
    I am making an app that displays long HTML documents (generated from 50 pages long Word documents) and it takes several seconds on my machine, so I'd like to have a QProgressDialog to show the progress.
    If I read the whole HTML file and call setHtml method, there is no way to show the progress.
    So I tried to read the file, then use QString::split("\n") and used QTextEdit::append for each line, but this resulted in having HTML file displayed as plain text, instead of rich text.
    So I tried with something similar to QString::split("<p>"). This improved the situation, but my HTML uses a lot the
    span class="classNAme"
    feature of HTML, and all the classes are defined in the first QTextEdit::append operation, while the following "append" operations seem to disregard the classes, and are badly displayed.

    Does anyone know a way to append HTML with QTextEdit::append, preserving header instruction of current HTML text?
    As an alternative, does anyone know another way to show loading progression, at least to show that loading is in progress (I tried to play with QCursor, with no luck).

    Thanks to everybody and marry Christmas

    Angelo

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tilsitt
      wrote on last edited by
      #2

      Hi,

      have you tried "QTextEdit::insertHtml":http://qt-project.org/doc/qt-4.8/qtextedit.html#insertHtml instead of append?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        angeFran
        wrote on last edited by
        #3

        Yes I have tried. Same behavior, except that loading is much slower.
        Thanks for replying

        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