Unsolved which QtextEdit widget is most less time consuming to show 3Gb file
-
which TextEdit widget is most less time to consume to show 3Gb file. QScintilla takes less time to load 3GB file
-
Hi
This one is fastest for text files
http://doc.qt.io/qt-5/qplaintextedit.html -
@Qt-Enthusiast
If you only wish to display the file you might useQLabel
. But otherwise I would expectQPlainTextEdit
is about as good as you'll get from out-of-the-box Qt. DedicatedQScintilla
code may well be more efficient in all sorts of ways (e.g. for all we know it might lazy-load your file), but it's separate code. Choice depends on what you want user to be able to do with content.QScintilla
is aimed at editing source code. -
If an app loads 3GB of text in my memory it's an auto-unistall for me.
3GB of text is 18000 Shakespeare's Hamlets. Nobody needs so much text loaded in memory
-
even if the size of file is 3GB
-
does it allow incremental loading on scroll bar movement
-
does it allow incremental loading on scroll bar movement
No, it doesn't even support loading from file. You would have to write that yourself.
Have a look at https://forum.qt.io/topic/4519/how-do-i-open-large-file-on-qtextedit
-
Hi
Also could you explain why you need to load such huge file?
On 32 bit system it will leave very little mem for rest of app. -
We work in such files where log file are around 0.3 GB files and we have to show text editor
-
@Qt-Enthusiast
ok so its only to show log files and not actually edit them? -
@mrjj said in which QtextEdit widget is most less time consuming to show 3Gb file:
On 32 bit system it will leave very little mem for rest of app.
On Windows 32bit an app has 2GB at most as far as I know.
-
@Qt-Enthusiast said in which QtextEdit widget is most less time consuming to show 3Gb file:
We work in such files where log file are around 0.3 GB files and we have to show text editor
I don't get it: is it 3GB or 0.3GB?
-
@jsulm
It seems to vary, what does a factor of 10 matter :) But either way it's "big" enough to cause OP time problems, so the question is valid. -
@JonB I did not say the question is invalid. But if one is asking a question he/she should provide consistent information. And loading 3GB of data is not the same as loading 300MB, especially not on 32bit systems. If you want to load 3GB of data you should consider memory mapped file IO to avoid consuming too much RAM or even crashing your app.