PDA

View Full Version : Display lots of text fast



franco.amato
31st December 2009, 16:12
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

squidge
31st December 2009, 17:45
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.

franco.amato
31st December 2009, 18:06
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
31st December 2009, 18:11
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

nateriver
31st December 2009, 18:13
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?

squidge
31st December 2009, 20:48
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.

faldzip
1st January 2010, 21:53
I would use QPlainTextEdit as it is faster and more simple QTextEdit version.