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. QPlainTextEdit can not handle large amounts of text
QtWS25 Last Chance

QPlainTextEdit can not handle large amounts of text

Scheduled Pinned Locked Moved General and Desktop
qplaintexteditkonsolestreamloglogging
2 Posts 2 Posters 1.9k 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.
  • JarggohJ Offline
    JarggohJ Offline
    Jarggoh
    wrote on last edited by
    #1

    QPlainTextEdit is propably the lightest widget to show plain text right?
    I have problems showing text stream (NMEA) coming from serial port (QSerialPort). The program becomes unresponsive very fast.
    Yet there is forexample the KDE Konsole, that can handle HUGE text streams, and even scroll it.
    What is the widget area in Konsole where the text is showing up? Can not figure it out from the huge source code...

    I know a human can not read the stream that fast, but that is not the point.
    Point is that the program should be able to handle the text stream without becoming unresponsive. Konsole handles it well.
    QPlainTextEdit can not handle even a slow text streams on it's own, does it require a limited fifo buffer to redraw text from or what could be the solution to a efficient way of showing text streams?
    Here is my simple serial console in GitHub: https://goo.gl/xXuMOa

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      One thing in you code is that in your receive function your are looping over each byte you received and ask to update the widget. What is generally done when handling large amount of data in such small amount is that the processing is done in a different thread. Also the UI update should be batched, there's no real benefit to update your QPlainTextEdit content for every single byte you get.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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