QTextDocument + QML TextArea ideas for handling large content
-
Hello, I made a WYSIWYG editor inspired by an example (https://doc.qt.io/qt-6/qtquickcontrols-texteditor-example.html )
The problems started when I inserted a large number of images, tables and text (about 40 pages) construct it via html builder who makes <div> with my content, so I use rich text.
When scrolling through content, a huge amount of memory is consumed, and when changing text (adding/deleting), there are lags for several seconds, as I understand it, due to the recalculation of the layout.You can check the performance of the qt example yourself by inserting huge html content there.
Perhaps someone has encountered this and there are ways to solve the problem?
I was thinking about requesting only the necessary pages from QTextDocument for display, and requesting another +-3 pages in one direction and the other when scrolling, but I'm not sure if this will solve the problem.
If you need more information, I will be happy to provide it.