Results 1 to 7 of 7

Thread: Displaying Text Quickly

  1. #1

    Default Displaying Text Quickly

    Hello--

    I made a post a few weeks back concerning being able to write to a text box quickly without having it lockup or become unresponsive. I had tried qtextedit and qlistview without success so someone suggested qtable. I tried qtable but that didn't work either--it works up until a certain point and then it couldn't keep up either. I did however get qtextedit to work in logtext mode--unfortunately, that basically takes away all selection abilities that I need.

    I was hoping that someone here might be able to help in this. I've come the conclusion that I don't necessarily have to have the text displaying while I record it, but I'd like to have it displayed after I stop sending in text. I was thinking that I could store it to a file and then load it afterwords, but I'm not sure if that's a good idea or not. Hopefully somebody will have a good suggestion for me. Thanks

    Aaron

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,365
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Displaying Text Quickly

    Are you using Qt3 or Qt4?

    Anyway, store your text in some datastructure, be it a simple QString (or QStringList) for Qt3 or a QTextDocument in Qt4 and after you're done feeding it, just send it to QTextBrowser or simmilar. You can use setUpdatesEnabled(false) to disable widget updates if you don't want to send the text at once.

  3. #3

    Default Re: Displaying Text Quickly

    Thanks for the suggestion, I'll try that. Right now I'm putting about 1200 characters every 50 milliseconds into the text windows (qt 3.3), but writing it in 100 character increments. If I can somehow spool that up maybe it will work like I want to without causing performance issues. Thanks

    Aaron

  4. #4
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying Text Quickly

    Wow you must be a fast reader

    Displaying the text that quickly wouldn't surprise me if it made the program sluggish. Do you need to display it or only to store it into a data structure?

  5. #5

    Default Re: Displaying Text Quickly

    I do have to display it eventually. I tried putting in a qtable without displaying it but I think the shear number of qtable operations was killing it. Is there an efficient way to store a lot of incoming text and then be able to display it without delay after the incoming text has finished? Like maybe qstring list like somebody suggested before? Thanks

    Aaron

  6. #6
    Join Date
    Jan 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying Text Quickly

    How are you receiving the data? It might be best to simply store a list(QStringList or QList<QByteArray>) of whatever you are receiving, and only join it together every certain time limit or when the data stops coming in. This will prevent copying data and doing screen update every 50 milliseconds. You could use a QTimer firing every 500ms or so to update the display, or just wait until until all the data is collected.

  7. #7

    Default Re: Displaying Text Quickly

    I queued up everything into a qstring list, and then write it to the textedit window--that seems to work great. However, if I add any rich text to it the scrolling becomes ridiculously slow (this is on a sun station, btw). Not sure if I can really do anything about that issue, unless there's some way to increase scrolling performance for text boxes (qt 3.3). Thanks everyone for all of your help so far.

    Aaron

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Displaying all characters in text edit
    By chadkeck in forum Qt Programming
    Replies: 1
    Last Post: 17th September 2008, 01:48
  3. Displaying text on a MDI area background
    By JPNaude in forum Qt Programming
    Replies: 10
    Last Post: 13th September 2008, 18:51
  4. displaying text
    By me_here_me in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2007, 10:48
  5. displaying Text in QTAble dynamically
    By raghvendramisra in forum Qt Programming
    Replies: 8
    Last Post: 31st August 2007, 10:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.