On 16/01/2013 09:47 ص, M. Bashir Al-Noimi wrote:
On 15/01/2013 01:16 ص, JM wrote:
Hi all,

I am using QTextEdit to display log text files, just like the Unix command tail -f. 
My current implementation just displays the last 5 lines and then follows the growing
log file, displaying lines as they come.
Now, I am asked to make QTextEdit display the whole file when the user opens a file.
A log file can be very large. I tested it with a 2mbyte file, and inserting data to QTextEdit
caused the GUI to freeze for almost 1 minute.
This is not acceptable, and I am looking for a solution. I have the following questions:

-) what is the fastest way to insert lots of text into QTextEdit?
-) should I go to the route of implementing my own QTextDisplay? If so, 
should I use QAbstractScrollArea as class base? Any pointer to how to use it?

Thanks in advance,
JM
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Personally I didn't face this issue before, but I suggest to use QTextBrowser because it optimized for text displaying or you can use QListWidget instead (I prefer it) thus it's easy to add tons of items as you want.

-- 
Best Regards
Muhammad Bashir Al-Noimi
I googled to see if there is an issue about it but I found this library which could be interesting for fixing logging issue:
http://www.qtilities.org/docs/v1_1/page_logging.html

-- 
Best Regards
Muhammad Bashir Al-Noimi
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to