Cppcheck
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Highlighter Class Reference

#include <codeeditor.h>

Inheritance diagram for Highlighter:

Classes

struct  HighlightingRule
 

Public Member Functions

 Highlighter (QTextDocument *parent, CodeEditorStyle *widgetStyle)
 
void setSymbols (const QStringList &symbols)
 
void setStyle (const CodeEditorStyle &newStyle)
 

Protected Member Functions

void highlightBlock (const QString &text) override
 

Private Types

enum  RuleRole {
  Keyword = 1 , Class = 2 , Comment = 3 , Quote = 4 ,
  Symbol = 5
}
 

Private Member Functions

void applyFormat (HighlightingRule &rule)
 

Private Attributes

QVector< HighlightingRulemHighlightingRules
 
QVector< HighlightingRulemHighlightingRulesWithSymbols
 
QRegularExpression mCommentStartExpression
 
QRegularExpression mCommentEndExpression
 
QTextCharFormat mKeywordFormat
 
QTextCharFormat mClassFormat
 
QTextCharFormat mSingleLineCommentFormat
 
QTextCharFormat mMultiLineCommentFormat
 
QTextCharFormat mQuotationFormat
 
QTextCharFormat mSymbolFormat
 
CodeEditorStylemWidgetStyle
 

Detailed Description

Definition at line 39 of file codeeditor.h.

Member Enumeration Documentation

◆ RuleRole

enum Highlighter::RuleRole
private
Enumerator
Keyword 
Class 
Comment 
Quote 
Symbol 

Definition at line 54 of file codeeditor.h.

Constructor & Destructor Documentation

◆ Highlighter()

Highlighter::Highlighter ( QTextDocument *  parent,
CodeEditorStyle widgetStyle 
)
explicit

Member Function Documentation

◆ applyFormat()

void Highlighter::applyFormat ( HighlightingRule rule)
private

◆ highlightBlock()

void Highlighter::highlightBlock ( const QString &  text)
overrideprotected

◆ setStyle()

void Highlighter::setStyle ( const CodeEditorStyle newStyle)

◆ setSymbols()

void Highlighter::setSymbols ( const QStringList &  symbols)

Member Data Documentation

◆ mClassFormat

QTextCharFormat Highlighter::mClassFormat
private

Definition at line 76 of file codeeditor.h.

Referenced by applyFormat(), Highlighter(), and setStyle().

◆ mCommentEndExpression

QRegularExpression Highlighter::mCommentEndExpression
private

Definition at line 73 of file codeeditor.h.

Referenced by highlightBlock(), and Highlighter().

◆ mCommentStartExpression

QRegularExpression Highlighter::mCommentStartExpression
private

Definition at line 72 of file codeeditor.h.

Referenced by highlightBlock(), and Highlighter().

◆ mHighlightingRules

QVector<HighlightingRule> Highlighter::mHighlightingRules
private

Definition at line 69 of file codeeditor.h.

Referenced by Highlighter(), setStyle(), and setSymbols().

◆ mHighlightingRulesWithSymbols

QVector<HighlightingRule> Highlighter::mHighlightingRulesWithSymbols
private

Definition at line 70 of file codeeditor.h.

Referenced by highlightBlock(), Highlighter(), setStyle(), and setSymbols().

◆ mKeywordFormat

QTextCharFormat Highlighter::mKeywordFormat
private

Definition at line 75 of file codeeditor.h.

Referenced by applyFormat(), Highlighter(), and setStyle().

◆ mMultiLineCommentFormat

QTextCharFormat Highlighter::mMultiLineCommentFormat
private

Definition at line 78 of file codeeditor.h.

Referenced by highlightBlock(), Highlighter(), and setStyle().

◆ mQuotationFormat

QTextCharFormat Highlighter::mQuotationFormat
private

Definition at line 79 of file codeeditor.h.

Referenced by applyFormat(), Highlighter(), and setStyle().

◆ mSingleLineCommentFormat

QTextCharFormat Highlighter::mSingleLineCommentFormat
private

Definition at line 77 of file codeeditor.h.

Referenced by applyFormat(), Highlighter(), and setStyle().

◆ mSymbolFormat

QTextCharFormat Highlighter::mSymbolFormat
private

Definition at line 80 of file codeeditor.h.

Referenced by applyFormat(), Highlighter(), setStyle(), and setSymbols().

◆ mWidgetStyle

CodeEditorStyle* Highlighter::mWidgetStyle
private

Definition at line 82 of file codeeditor.h.

Referenced by Highlighter().


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