[QScintilla] QSciLexer blockStart & blockEnd return type error

Phil Thompson phil at riverbankcomputing.com
Sun Mar 24 11:37:38 GMT 2019


On 24 Mar 2019, at 11:15 am, Matic Kukovec <kukovecmatic at hotmail.com> wrote:
> 
> Hi Phil,
> 
> I have these two methods in a QsciLexerCustom:
>     def blockStart(self, style=0):
>         return data.QByteArray(1, "{")
>         
>     def blockEnd(self, style=0):
>         return data.QByteArray(1, "}")
> 
> But on pressing Enter inside the editor always throws: TypeError: invalid result from MyLexer.blockStart()
> I also tried return bytes("{", encoding="utf-8") and return "{", but those also throw the same error.
> This is on PyQt5.11.3 / QScintilla2.10.8.
> 
> Am I missing something?

help(QsciLexer.blockStart)

Phil


More information about the QScintilla mailing list