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. Fastest way to display large QString in a QT window?
Forum Updated to NodeBB v4.3 + New Features

Fastest way to display large QString in a QT window?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 303 Views 2 Watching
  • 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
    amadeok
    wrote on last edited by
    #1

    Hello
    Could you advice the fastest way to display a QString in something like a QPlainTextEdit?
    Right now i'm just calling setPlainText() , and it's ok for small files bur for large files it can take a second or two, for example a 11mb file with 647k lines takes about 2 seconds while a 20mb file with 152k lines takes about 600ms.
    thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You may have a bit more luck with QTextDocument, I think it lazy-loads the data. If not, you'll probably have to manually load the file in chunks.

      (Z(:^

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Max13
        wrote on last edited by
        #3

        https://forum.qt.io/topic/4519/how-do-i-open-large-file-on-qtextedit

        We all have started by asking questions. Then after some time, we can begin answering them.

        1 Reply Last reply
        2

        • Login

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