Cppcheck
|
#include <codeeditor.h>
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< HighlightingRule > | mHighlightingRules |
QVector< HighlightingRule > | mHighlightingRulesWithSymbols |
QRegularExpression | mCommentStartExpression |
QRegularExpression | mCommentEndExpression |
QTextCharFormat | mKeywordFormat |
QTextCharFormat | mClassFormat |
QTextCharFormat | mSingleLineCommentFormat |
QTextCharFormat | mMultiLineCommentFormat |
QTextCharFormat | mQuotationFormat |
QTextCharFormat | mSymbolFormat |
CodeEditorStyle * | mWidgetStyle |
Definition at line 39 of file codeeditor.h.
|
private |
Enumerator | |
---|---|
Keyword | |
Class | |
Comment | |
Quote | |
Symbol |
Definition at line 54 of file codeeditor.h.
|
explicit |
Definition at line 45 of file codeeditor.cpp.
References CodeEditorStyle::classColor, CodeEditorStyle::classWeight, CodeEditorStyle::commentColor, CodeEditorStyle::commentWeight, Highlighter::HighlightingRule::format, CodeEditorStyle::keywordColor, CodeEditorStyle::keywordWeight, mClassFormat, mCommentEndExpression, mCommentStartExpression, mHighlightingRules, mHighlightingRulesWithSymbols, mKeywordFormat, mMultiLineCommentFormat, mQuotationFormat, mSingleLineCommentFormat, mSymbolFormat, mWidgetStyle, Highlighter::HighlightingRule::pattern, CodeEditorStyle::quoteColor, CodeEditorStyle::quoteWeight, Highlighter::HighlightingRule::ruleRole, CodeEditorStyle::symbolBGColor, CodeEditorStyle::symbolFGColor, and CodeEditorStyle::symbolWeight.
|
private |
Definition at line 251 of file codeeditor.cpp.
References Highlighter::HighlightingRule::format, mClassFormat, mKeywordFormat, mQuotationFormat, mSingleLineCommentFormat, mSymbolFormat, and Highlighter::HighlightingRule::ruleRole.
Referenced by setStyle().
|
overrideprotected |
Definition at line 219 of file codeeditor.cpp.
References match(), mCommentEndExpression, mCommentStartExpression, mHighlightingRulesWithSymbols, and mMultiLineCommentFormat.
void Highlighter::setStyle | ( | const CodeEditorStyle & | newStyle | ) |
Definition at line 195 of file codeeditor.cpp.
References applyFormat(), CodeEditorStyle::classColor, CodeEditorStyle::classWeight, CodeEditorStyle::commentColor, CodeEditorStyle::commentWeight, CodeEditorStyle::keywordColor, CodeEditorStyle::keywordWeight, mClassFormat, mHighlightingRules, mHighlightingRulesWithSymbols, mKeywordFormat, mMultiLineCommentFormat, mQuotationFormat, mSingleLineCommentFormat, mSymbolFormat, CodeEditorStyle::quoteColor, CodeEditorStyle::quoteWeight, CodeEditorStyle::symbolBGColor, CodeEditorStyle::symbolFGColor, and CodeEditorStyle::symbolWeight.
Referenced by CodeEditor::setStyle().
void Highlighter::setSymbols | ( | const QStringList & | symbols | ) |
Definition at line 183 of file codeeditor.cpp.
References Highlighter::HighlightingRule::format, mHighlightingRules, mHighlightingRulesWithSymbols, mSymbolFormat, Highlighter::HighlightingRule::pattern, and Highlighter::HighlightingRule::ruleRole.
Referenced by CodeEditor::setError().
|
private |
Definition at line 76 of file codeeditor.h.
Referenced by applyFormat(), Highlighter(), and setStyle().
|
private |
Definition at line 73 of file codeeditor.h.
Referenced by highlightBlock(), and Highlighter().
|
private |
Definition at line 72 of file codeeditor.h.
Referenced by highlightBlock(), and Highlighter().
|
private |
Definition at line 69 of file codeeditor.h.
Referenced by Highlighter(), setStyle(), and setSymbols().
|
private |
Definition at line 70 of file codeeditor.h.
Referenced by highlightBlock(), Highlighter(), setStyle(), and setSymbols().
|
private |
Definition at line 75 of file codeeditor.h.
Referenced by applyFormat(), Highlighter(), and setStyle().
|
private |
Definition at line 78 of file codeeditor.h.
Referenced by highlightBlock(), Highlighter(), and setStyle().
|
private |
Definition at line 79 of file codeeditor.h.
Referenced by applyFormat(), Highlighter(), and setStyle().
|
private |
Definition at line 77 of file codeeditor.h.
Referenced by applyFormat(), Highlighter(), and setStyle().
|
private |
Definition at line 80 of file codeeditor.h.
Referenced by applyFormat(), Highlighter(), setStyle(), and setSymbols().
|
private |
Definition at line 82 of file codeeditor.h.
Referenced by Highlighter().