(moved discussion from http://www.qtcentre.org/forum/f-qt-s...r-qt-8156.html)
You must be crazy. You little text editor will be able to handle only latin1 and similar charsets. Will you support chinese? Japanese? Arabic? Hebrew? Hindic?True enough. But you won't be able to get rid of it as long as you cling to QTextDocument... This class does a great job rendering rich text but it sucks when it comes to complying with the need of coders : speed, small memory usage, loading big files, highlighting ... That's why I'm working on a new version of QCodeEdit which already offers a working (I did not say "usable" yet!) alternative to QTextDocument and fulfils all the aforementioned requirement. You might also be interested in QScintilla port to Qt 4 but beware it has a really crappy API...
And about QSyntaxHighlighter? That one stinks. I would like to get more integration between QTextDocument and QSyntaxHighlighter. For example, when pressing "QString::" I would like to know in which document-context this string it, since it's in a comment - I do not need to pop-up the code completion code. If text is entered inside #include, I want to know about it to open a completion menu with the available headers.
Re-writing stuff is always fun, but the real question is what do you gain. Sure QTextDocument is slow, but it has a LOT of features. The problem is the highlighters, which not only are a solid-black-box: they are also badly written.
Bookmarks