BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
PythonSyntaxHighlighter Class Reference

Description

Implementation of highlighting for Python code.

Definition at line 61 of file PythonSyntaxHighlighter.h.

Inheritance diagram for PythonSyntaxHighlighter:
[legend]
Collaboration diagram for PythonSyntaxHighlighter:
[legend]

Public Member Functions

 PythonSyntaxHighlighter (QTextDocument *parent=nullptr)
 

Protected Member Functions

void highlightBlock (const QString &text) override
 

Private Member Functions

QTextCharFormat getTextCharFormat (const QString &colorName, const QString &style="")
 
void initializeRules ()
 
bool matchMultiline (const QString &text, const QRegExp &delimiter, int inState, const QTextCharFormat &style)
 Highlighst multi-line strings, returns true if after processing we are still within the. More...
 

Private Attributes

QHash< QString, QTextCharFormat > basicStyles
 
QStringList braces
 
QStringList keywords
 
QStringList operators
 
QList< HighlightingRulerules
 
QRegExp triDoubleQuote
 
QRegExp triSingleQuote
 

Constructor & Destructor Documentation

◆ PythonSyntaxHighlighter()

PythonSyntaxHighlighter::PythonSyntaxHighlighter ( QTextDocument *  parent = nullptr)

Definition at line 40 of file PythonSyntaxHighlighter.cpp.

References basicStyles, braces, getTextCharFormat(), initializeRules(), keywords, operators, triDoubleQuote, and triSingleQuote.

Here is the call graph for this function:

Member Function Documentation

◆ getTextCharFormat()

QTextCharFormat PythonSyntaxHighlighter::getTextCharFormat ( const QString &  colorName,
const QString &  style = "" 
)
private

Referenced by PythonSyntaxHighlighter().

◆ highlightBlock()

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

◆ initializeRules()

void PythonSyntaxHighlighter::initializeRules ( )
private

Referenced by PythonSyntaxHighlighter().

◆ matchMultiline()

bool PythonSyntaxHighlighter::matchMultiline ( const QString &  text,
const QRegExp &  delimiter,
int  inState,
const QTextCharFormat &  style 
)
private

Highlighst multi-line strings, returns true if after processing we are still within the.

Member Data Documentation

◆ basicStyles

QHash<QString, QTextCharFormat> PythonSyntaxHighlighter::basicStyles
private

Definition at line 74 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().

◆ braces

QStringList PythonSyntaxHighlighter::braces
private

Definition at line 72 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().

◆ keywords

QStringList PythonSyntaxHighlighter::keywords
private

Definition at line 70 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().

◆ operators

QStringList PythonSyntaxHighlighter::operators
private

Definition at line 71 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().

◆ rules

QList<HighlightingRule> PythonSyntaxHighlighter::rules
private

Definition at line 84 of file PythonSyntaxHighlighter.h.

◆ triDoubleQuote

QRegExp PythonSyntaxHighlighter::triDoubleQuote
private

Definition at line 86 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().

◆ triSingleQuote

QRegExp PythonSyntaxHighlighter::triSingleQuote
private

Definition at line 85 of file PythonSyntaxHighlighter.h.

Referenced by PythonSyntaxHighlighter().


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