[QScintilla] Editor with a custom lexer keeps flashing when editing

agarny at hellix.com agarny at hellix.com
Tue May 31 01:02:13 BST 2016


Hi Neil,

I am currently working on upgrading to Qt 5.5.1 from 5.4.2 in my 
project. It's all working fine for different QScintilla-based editors 
that I have in my application, except for one. The only difference 
between that editor and the others is that it relies on a custom lexer. 
As you might expect, that lexer is implemented in a class that inherits 
from QsciLexerCustom (see https://goo.gl/cjrYCM and 
https://goo.gl/cMojqk).

Now, my problem, when my project is built using Qt 5.5.1 on OS X 
(everything works fine on Windows and Linux), is that if I then try to 
edit something in that particular editor, then I get one or two black 
lines flashing repeatedly for as long as I keep editing.

After some debugging, I found out that the 'culprit' is Editor::Paint(), 
more precisely the paintState == paintAbandoned if clause. That if 
clause is true then it will return after it has done what it needs to 
do. Now, if I comment out the return statement (see 
https://goo.gl/5jDdXt), everything works fine for me (i.e. I don't get 
the one or two black lines flashing repeatedly).

So, although I have got things to work fine for my application, I wanted 
to check with you that what I have done is actually 'safe'. If it is, 
then maybe this is something that could be merged in?

Cheers, Alan.


More information about the QScintilla mailing list