#include <qscilexercustom.h>
Inherits QsciLexer.
The advantage of implementing a new lexer this way (as opposed to adding the lexer to the underlying Scintilla code) is that it does not require the QScintilla library to be re-compiled. It also makes it possible to integrate external lexers.
All that is necessary to implement a new lexer is to define appropriate styles and to re-implement the styleText() method.
QsciLexerCustom::QsciLexerCustom | ( | QObject * | parent = 0 |
) |
Construct a QsciLexerCustom with parent parent. parent is typically the QsciScintilla instance.
virtual QsciLexerCustom::~QsciLexerCustom | ( | ) | [virtual] |
Destroy the QSciLexerCustom.
void QsciLexerCustom::setStyling | ( | int | length, | |
int | style | |||
) |
The next length characters starting from the current styling position have their style set to style number style. The current styling position is moved. The styling position is initially set by calling startStyling().
void QsciLexerCustom::setStyling | ( | int | length, | |
const QsciStyle & | style | |||
) |
The next length characters starting from the current styling position have their style set to style style. The current styling position is moved. The styling position is initially set by calling startStyling().
void QsciLexerCustom::startStyling | ( | int | pos, | |
int | style_bits = 0 | |||
) |
The styling position is set to start and the mask of style bits that can be set is set to style_bits. style_bits allows the styling of text to be done over several passes by setting different style bits on each pass. If style_bits is 0 then all style bits (as returned by styleBitsNeeded()) are set.
virtual void QsciLexerCustom::styleText | ( | int | start, | |
int | end | |||
) | [pure virtual] |
This is called when the section of text beginning at position start and up to position end needs to be styled. start will always be at the start of a line. The text is styled by calling startStyling() followed by one or more calls to setStyling(). It must be re-implemented by a sub-class.
virtual void QsciLexerCustom::setEditor | ( | QsciScintilla * | editor | ) | [virtual] |
virtual int QsciLexerCustom::styleBitsNeeded | ( | ) | const [virtual] |
This re-implementation returns 5 as the number of style bits needed.
Reimplemented from QsciLexer.