Developer Documentation
Loading...
Searching...
No Matches
PythonSyntaxHighlighter Class Reference

Implementation of highlighting for Python code. More...

#include <OpenFlipper/widgets/pythonWidget/PythonSyntaxHighlighter.hh>

Inheritance diagram for PythonSyntaxHighlighter:

Public Member Functions

 PythonSyntaxHighlighter (QTextDocument *parent=0)
 

Protected Member Functions

void highlightBlock (const QString &text)
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Implementation of highlighting for Python code.

Definition at line 52 of file PythonSyntaxHighlighter.hh.

Constructor & Destructor Documentation

◆ PythonSyntaxHighlighter()

PythonSyntaxHighlighter::PythonSyntaxHighlighter ( QTextDocument *  parent = 0)
explicit

Definition at line 26 of file PythonSyntaxHighlighter.cc.

Member Function Documentation

◆ getTextCharFormat()

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

Definition at line 176 of file PythonSyntaxHighlighter.cc.

◆ highlightBlock()

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

Definition at line 106 of file PythonSyntaxHighlighter.cc.

◆ initializeRules()

void PythonSyntaxHighlighter::initializeRules ( )
private

Definition at line 65 of file PythonSyntaxHighlighter.cc.

◆ matchMultiline()

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

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

Definition at line 131 of file PythonSyntaxHighlighter.cc.

Member Data Documentation

◆ basicStyles

QHash<QString, QTextCharFormat> PythonSyntaxHighlighter::basicStyles
private

Definition at line 64 of file PythonSyntaxHighlighter.hh.

◆ braces

QStringList PythonSyntaxHighlighter::braces
private

Definition at line 62 of file PythonSyntaxHighlighter.hh.

◆ keywords

QStringList PythonSyntaxHighlighter::keywords
private

Definition at line 60 of file PythonSyntaxHighlighter.hh.

◆ operators

QStringList PythonSyntaxHighlighter::operators
private

Definition at line 61 of file PythonSyntaxHighlighter.hh.

◆ rules

QList<HighlightingRule> PythonSyntaxHighlighter::rules
private

Definition at line 72 of file PythonSyntaxHighlighter.hh.

◆ triDoubleQuote

QRegularExpression PythonSyntaxHighlighter::triDoubleQuote
private

Definition at line 74 of file PythonSyntaxHighlighter.hh.

◆ triSingleQuote

QRegularExpression PythonSyntaxHighlighter::triSingleQuote
private

Definition at line 73 of file PythonSyntaxHighlighter.hh.


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