[Interest] Guide me through the Qt offerings for GUIs

Matthew Woehlke mwoehlke.floss at gmail.com
Tue Apr 20 16:18:03 CEST 2021


On 20/04/2021 09.10, Roland Hughes wrote:
> Close on the heels of that "Why are they highlighting the whole thing?" 
> when you only need the currently visible lines and possibly a screen 
> up/down. Open up a 10,000 line source file in editors using Scintilla or 
> the Electron JavaScript based things, or even GUI Emacs even on an 
> i5-gen3 and you are almost instantly taken to the line you were on with 
> perfect syntax highlighting.

Frankly, I am skeptical. At best I think you are misrepresenting the 
problem.

It's well known that you *have* to highlight the whole file, at least to 
the current position, for accurate ("perfect") highlighting. At least in 
the general case. There may be some files and/or syntaxes for which that 
it not the case, but vim has had partial highlighting for almost 
forever, and I've seen it drop the ball on plenty of occasions, because 
something earlier in the file changes correct highlighting for the 
visible part.

That said, Qt definitely does not have a widget that can do a reasonable 
job of syntax highlighting a large file. Katepart, which does a pretty 
good job, is very much its own implementation of a text editor with very 
little high level Qt code involved. (At least that used to be the case; 
I think some of the actual text parsing may have moved *into* Qt *from* 
katepart. Back when I was involved with it, however, it used Qt for text 
rendering and low level input, but I believe all the higher level logic 
for input handling and layouting was reimplemented.)

-- 
Matthew


More information about the Interest mailing list