SyntaxHighlighter Class

(TextEditor::SyntaxHighlighter)

Public Functions

SyntaxHighlighter(QObject *parent = 0)
SyntaxHighlighter(QTextDocument *parent)
SyntaxHighlighter(QTextEdit *parent)
virtual ~SyntaxHighlighter()
QTextDocument *document() const
void setDocument(QTextDocument *doc)
void setExtraFormats(const QTextBlock &block, QVector<QTextLayout::FormatRange> &formats)
virtual void setFontSettings(const TextEditor::FontSettings &fontSettings)
  • 32 public functions inherited from QObject

Public Slots

void rehighlight()
void rehighlightBlock(const QTextBlock &block)
  • 1 public slot inherited from QObject

Static Public Members

QList<QColor> generateColors(int n, const QColor &background)
  • 10 static public members inherited from QObject

Protected Functions

void applyFormatToSpaces(const QString &text, const QTextCharFormat &format)
QTextBlock currentBlock() const
int currentBlockState() const
QTextBlockUserData *currentBlockUserData() const
QTextCharFormat format(int pos) const
QTextCharFormat formatForCategory(int categoryIndex) const
virtual void highlightBlock(const QString &text) = 0
int previousBlockState() const
void setCurrentBlockState(int newState)
void setCurrentBlockUserData(QTextBlockUserData *data)
void setFormat(int start, int count, const QTextCharFormat &format)
void setFormat(int start, int count, const QColor &color)
void setFormat(int start, int count, const QFont &font)
void setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 2 signals inherited from QObject
  • 1 public variable inherited from QObject
  • 2 protected variables inherited from QObject

Member Function Documentation

SyntaxHighlighter::SyntaxHighlighter(QObject *parent = 0)

Default constructs an instance of SyntaxHighlighter.

SyntaxHighlighter::SyntaxHighlighter(QTextDocument *parent)

Default constructs an instance of SyntaxHighlighter.

SyntaxHighlighter::SyntaxHighlighter(QTextEdit *parent)

Default constructs an instance of SyntaxHighlighter.

[virtual] SyntaxHighlighter::~SyntaxHighlighter()

Destroys the instance of SyntaxHighlighter. The destructor is virtual.

[protected] void SyntaxHighlighter::applyFormatToSpaces(const QString &text, const QTextCharFormat &format)

[protected] QTextBlock SyntaxHighlighter::currentBlock() const

[protected] int SyntaxHighlighter::currentBlockState() const

See also setCurrentBlockState().

[protected] QTextBlockUserData *SyntaxHighlighter::currentBlockUserData() const

See also setCurrentBlockUserData().

QTextDocument *SyntaxHighlighter::document() const

See also setDocument().

[protected] QTextCharFormat SyntaxHighlighter::format(int pos) const

See also setFormat().

[protected] QTextCharFormat SyntaxHighlighter::formatForCategory(int categoryIndex) const

[static] QList<QColor> SyntaxHighlighter::generateColors(int n, const QColor &background)

[pure virtual protected] void SyntaxHighlighter::highlightBlock(const QString &text)

[protected] int SyntaxHighlighter::previousBlockState() const

[slot] void SyntaxHighlighter::rehighlight()

[slot] void SyntaxHighlighter::rehighlightBlock(const QTextBlock &block)

[protected] void SyntaxHighlighter::setCurrentBlockState(int newState)

See also currentBlockState().

[protected] void SyntaxHighlighter::setCurrentBlockUserData(QTextBlockUserData *data)

See also currentBlockUserData().

void SyntaxHighlighter::setDocument(QTextDocument *doc)

See also document().

void SyntaxHighlighter::setExtraFormats(const QTextBlock &block, QVector<QTextLayout::FormatRange> &formats)

[virtual] void SyntaxHighlighter::setFontSettings(const TextEditor::FontSettings &fontSettings)

[protected] void SyntaxHighlighter::setFormat(int start, int count, const QTextCharFormat &format)

See also format().

[protected] void SyntaxHighlighter::setFormat(int start, int count, const QColor &color)

[protected] void SyntaxHighlighter::setFormat(int start, int count, const QFont &font)

[protected] void SyntaxHighlighter::setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories)