SeExpr

Classes | Public Member Functions | Private Attributes | List of all members
ExprHighlighter Class Reference

`#include <ExprHighlighter.h>`

Inheritance diagram for ExprHighlighter:

## Classes
struct | HighlightingRule

## Public Member Functions
| ExprHighlighter (QTextDocument *parent)
| ExprHighlighter (QTextEdit *edit)
void | fixStyle (const QPalette &palette)
void | init ()
void | highlightBlock (const QString &text)

## Private Attributes
QVector< HighlightingRule > | highlightingRules
QTextCharFormat | singleLineCommentFormat
QTextCharFormat | variableFormat
QTextCharFormat | numberFormat
QTextCharFormat | operatorFormat
int | lightness

## Detailed Description

Definition at line 27 of file ExprHighlighter.h.

## Constructor & Destructor Documentation

## ◆ ExprHighlighter() [1/2]

ExprHighlighter::ExprHighlighter | ( | QTextDocument * | parent | ) |
| inline

Definition at line 41 of file ExprHighlighter.h.

References init().

## ◆ ExprHighlighter() [2/2]

ExprHighlighter::ExprHighlighter | ( | QTextEdit * | edit | ) |
| inline

Definition at line 43 of file ExprHighlighter.h.

References init().

## Member Function Documentation

## ◆ fixStyle()

void ExprHighlighter::fixStyle | ( | const QPalette & | palette | ) |
| inline

Definition at line 45 of file ExprHighlighter.h.

References init(), and lightness.

Referenced by ExprShortTextEdit::ExprShortTextEdit(), ExprTextEdit::paintEvent(), ExprShortTextEdit::paintEvent(), and ExprTextEdit::updateStyle().

## ◆ highlightBlock()

void ExprHighlighter::highlightBlock | ( | const QString & | text | ) |
| inline

Definition at line 81 of file ExprHighlighter.h.

References expression, ExprHighlighter::HighlightingRule::format, highlightingRules, index(), SeExpr2::length(), and ExprHighlighter::HighlightingRule::pattern.

## ◆ init()

void ExprHighlighter::init | ( |  | ) |
| inline

Definition at line 50 of file ExprHighlighter.h.

References ExprHighlighter::HighlightingRule::format, highlightingRules, lightness, numberFormat, ExprHighlighter::HighlightingRule::pattern, singleLineCommentFormat, and variableFormat.

Referenced by ExprHighlighter(), and fixStyle().

## Member Data Documentation

## ◆ highlightingRules

QVector<HighlightingRule> ExprHighlighter::highlightingRules
| private

Definition at line 32 of file ExprHighlighter.h.

Referenced by highlightBlock(), and init().

## ◆ lightness

int ExprHighlighter::lightness
| private

Definition at line 38 of file ExprHighlighter.h.

Referenced by fixStyle(), and init().

## ◆ numberFormat

QTextCharFormat ExprHighlighter::numberFormat
| private

Definition at line 35 of file ExprHighlighter.h.

Referenced by init().

## ◆ operatorFormat

QTextCharFormat ExprHighlighter::operatorFormat
| private

Definition at line 36 of file ExprHighlighter.h.

## ◆ singleLineCommentFormat

QTextCharFormat ExprHighlighter::singleLineCommentFormat
| private

Definition at line 33 of file ExprHighlighter.h.

Referenced by init().

## ◆ variableFormat

QTextCharFormat ExprHighlighter::variableFormat
| private

Definition at line 34 of file ExprHighlighter.h.

Referenced by init().

The documentation for this class was generated from the following file:

- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprHighlighter.h