Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Handling large strings (e.g. log files) in TextArea/TextEdit
Forum Updated to NodeBB v4.3 + New Features

Handling large strings (e.g. log files) in TextArea/TextEdit

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 141 Views 1 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.
  • K Offline
    K Offline
    Kenz Dale
    wrote on last edited by Kenz Dale
    #1

    I have a serial console application I've written, and its job is to display the incoming serial data. I use a TextArea because it integrates nicely into Flickable (via the Flickable.TextArea property). This works extremely well, in terms of it giving me the desired visual results and look and feel. It also lets me have fun features like the ability to highlight large blocks of text in one view and map those across views (for instance, if I wanted to see the ASCII text in one view and the corresponding hex code in another)

    The problem is that as the string of text gets longer and longer, the performance starts falling off the cliff. Adding new data causes the application to start to lag. And not after several MB of characters, but maybe after just a thousand lines or so.

    I have spent several hours this morning looking for a solution to this problem, and haven't found anything which looks like it could do the job. I very much need/want all the good things which come with the TextArea, I just don't want it to bog down the program.

    I've followed the following advice in the TextEdit documentation:

    In order to append without inserting a new paragraph, call myTextEdit.insert(myTextEdit.length, text) instead.

    I also use textFormat: TextEdit.PlainText (although I would have liked to be able to use rich text so I can give more semantical meaning to the view).

    Is it fair to expect TextArea to be able to handle thousands of lines? If not, what is the right answer? Is there something similar to where I can have my cake and eat it to?

    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