Question

I have been messing around with creating my own Progress 4GL Editor recently by implementing QsciLexerCustom in my python application. But while browsing through the Qscintilla Source i noticed they already have a progress 4gl lexer in QScintilla/lexers/LexProgress.cpp but while reading http://www.riverbankcomputing.com/static/Docs/QScintilla2/annotated.html they dont specify any QsciLexerProgress class or any means of accessing this lexer, that i can see.

Does anyone know how to do this?

Any help would be much appreciated.

Était-ce utile?

La solution

QScintilla is apparently a port of Scintilla to use the Qt GUI framework. It probably requires a bit of work to port a lexer, so they probably just didn't spend the time porting the lexers for unpopular languages.

In other words, I think the .cpp file you found is just a remnant from Scintilla that never got ported over to QScintilla but is still in their code base.

Autres conseils

The QSciLexer* classes are misleadingly named. They aren't really lexers at all. Rather they provide a wrapper for the properties files used by the Scintilla-based editor, SciTE. Properties files contain all the settings (fonts, colours, keywords, etc) that are required to configure a specific Scintilla lexer.

By default, QScintilla does not provide a QsciLexer* class for every language that Scintilla supports. It just provides ones for the most commonly used languages, plus any that are requested by users on the mailing list. AFAIK, the author of Qscintilla is happy to add a QsciLexer* class for any language supported by Scintilla - the only requirement being that a usable SciTE properties file exists for the corresponding lexer.

Unfortunately, the current SciTE sources don't include a properties file for the Progress 4GL lexer! However, it's entirely possible that someone created one at some time, so a little searching will likely produce one. Failing that, you could always create one yourself.

PS: It's a real annoyance that QScintilla doesn't allow the QsciLexer class to be subclassed properly (some of the critical virtual functions aren't public). If it was, it would be possible to create a custom wrapper class for any language supported by Scintilla, without having to ask the author of Qscintilla to add one.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top