[PyQt] QsciLexerCustom class behaving differently in PyQt5?

Dominique Cyprès lunasspecto at gmail.com
Sun Nov 2 03:52:55 GMT 2014


Hi,

I'm having trouble understanding the differences in behavior between
implementations of the QsciLexerCustom class in PyQt5 and PyQt4.

I've been trying to work with a subclass of this, and was basing my work
on some example code posted to this list on 12 July 2009 by Baz Walter,
which I've copied to a pastebin:
http://pastebin.com/eqRpBx0H

After some trouble adapting this code for my PyQt5 project, I decided to
simply make a few minimal adjustments to the code to make it run without
errors in a Python 3 / PyQt5 environment:
http://pastebin.com/pgS28wZ8

Running the latter code results in a lexer that does not apply color to
any of the sample source text at all.

So you can see what I mean, here's a screenshot of the example code
running on Python 2.7.6 with PyQt4:
https://www.dropbox.com/s/zqcbsb9o3o8uky9/pyqt4-custom-lexer.png

And here's a screenshot of the reworked example code running on Python
3.4.0 with PyQt5:
https://www.dropbox.com/s/8elynzf3ms4bwg1/pyqt5-custom-lexer.png

Is there some documentation that explains why this code behaves
differently in PyQt5?

Thanks,
Dominique


More information about the PyQt mailing list