Results 1 to 7 of 7

Thread: Display lots of text fast

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Display lots of text fast

    Hi,
    I would like to display lots of text line ( file path ) as fast as possible.
    I would implement a directory content display and I would display the content ( the file list recursively ) in a fast way.
    Which Qwidget can I use? The directory can also contain 10E6 files.

    Best Regards,
    Franco
    Franco Amato

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Display lots of text fast

    Is there a reason you want to display lots of text fast? If your using the same area, then people are not going to be able to read it all anyway, so why not update much slower? As in, forget about displaying every filename, just show the latest (or update a file listing with the latest) 10 times a second or so and reduce cpu usage.

    Maybe a QTableModel will be best for you, but updating it hundreds of times a second will quickly consume all cpu usage with gui updates.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display lots of text fast

    Quote Originally Posted by fatjuicymole View Post
    Is there a reason you want to display lots of text fast? If your using the same area, then people are not going to be able to read it all anyway, so why not update much slower? As in, forget about displaying every filename, just show the latest (or update a file listing with the latest) 10 times a second or so and reduce cpu usage.

    Maybe a QTableModel will be best for you, but updating it hundreds of times a second will quickly consume all cpu usage with gui updates.
    Hi people don't have to read the text.
    I have a code that list recursively the content of a big directory and I would show the file list in some QWidget
    Franco Amato

  4. #4
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display lots of text fast

    Quote Originally Posted by fatjuicymole View Post
    Is there a reason you want to display lots of text fast? If your using the same area, then people are not going to be able to read it all anyway, so why not update much slower? As in, forget about displaying every filename, just show the latest (or update a file listing with the latest) 10 times a second or so and reduce cpu usage.

    Maybe a QTableModel will be best for you, but updating it hundreds of times a second will quickly consume all cpu usage with gui updates.
    QTableModel seems more complex than what I need.
    I think I only need some log widget
    Franco Amato

  5. #5
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Display lots of text fast

    Quote Originally Posted by franco.amato View Post
    I would show the file list in some QWidget
    But why do you need to show it if people don't need to read it?
    "Do be do be do", Frank Sinatra

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Display lots of text fast

    QTextEdit would more closely a log widget, but you asked for performance, and QTableModel would be better in that case, as you provide the data the user can see at the time rather than adding every line.

  7. #7
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display lots of text fast

    I would use QPlainTextEdit as it is faster and more simple QTextEdit version.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. QLogText & QLogTable : 2 widgets to display text log
    By fcoiffie in forum Qt-based Software
    Replies: 7
    Last Post: 28th April 2019, 07:52
  2. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  3. Howto display QPixmap and Text?
    By segi in forum Newbie
    Replies: 20
    Last Post: 28th July 2009, 10:49
  4. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 22:46
  5. QTableWidget setSpan text display problem
    By sureshbabu in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2008, 16:14

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.