umbrello 25.07.90
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
CodeTextHighlighter Class Reference

#include <codetexthighlighter.h>

Inheritance diagram for CodeTextHighlighter:

Classes

struct  HighlightingRule

Public Member Functions

 CodeTextHighlighter (QTextDocument *parent=nullptr)

Protected Member Functions

void highlightBlock (const QString &text)

Private Member Functions

QStringList keywords ()

Private Attributes

QVector< HighlightingRulem_highlightingRules
QRegularExpression m_commentStartExpression
QRegularExpression m_commentEndExpression
QTextCharFormat m_keywordFormat
QTextCharFormat m_classFormat
QTextCharFormat m_singleLineCommentFormat
QTextCharFormat m_multiLineCommentFormat
QTextCharFormat m_quotationFormat
QTextCharFormat m_functionFormat

Constructor & Destructor Documentation

◆ CodeTextHighlighter()

CodeTextHighlighter::CodeTextHighlighter ( QTextDocument * parent = nullptr)
explicit

Constructor. Creates the highlighting rule by calling the function keywords().

Parameters
parentthe parent QTextDocument

Member Function Documentation

◆ highlightBlock()

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

Does highlighting the code block.

Parameters
textthe code block to highlight

◆ keywords()

QStringList CodeTextHighlighter::keywords ( )
private

Create a list of keywords for the selected programming language.

Returns
list of keywords

Member Data Documentation

◆ m_classFormat

QTextCharFormat CodeTextHighlighter::m_classFormat
private

◆ m_commentEndExpression

QRegularExpression CodeTextHighlighter::m_commentEndExpression
private

◆ m_commentStartExpression

QRegularExpression CodeTextHighlighter::m_commentStartExpression
private

◆ m_functionFormat

QTextCharFormat CodeTextHighlighter::m_functionFormat
private

◆ m_highlightingRules

QVector<HighlightingRule> CodeTextHighlighter::m_highlightingRules
private

◆ m_keywordFormat

QTextCharFormat CodeTextHighlighter::m_keywordFormat
private

◆ m_multiLineCommentFormat

QTextCharFormat CodeTextHighlighter::m_multiLineCommentFormat
private

◆ m_quotationFormat

QTextCharFormat CodeTextHighlighter::m_quotationFormat
private

◆ m_singleLineCommentFormat

QTextCharFormat CodeTextHighlighter::m_singleLineCommentFormat
private

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