COPASI API  4.16.103
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
CQExpressionHighlighter Class Reference

The class for highlighting the expression syntax. More...

#include <CQExpressionWidget.h>

Inheritance diagram for CQExpressionHighlighter:
Inheritance graph
[legend]
Collaboration diagram for CQExpressionHighlighter:
Collaboration graph
[legend]

Public Member Functions

 CQExpressionHighlighter (CQExpressionWidget *ew)
 
virtual ~CQExpressionHighlighter ()
 

Public Attributes

QTextCharFormat mObjectDisplayFormat
 
QRegExp mObjectDisplayPattern
 

Protected Member Functions

void highlightBlock (const QString &text)
 

Detailed Description

The class for highlighting the expression syntax.

Definition at line 38 of file CQExpressionWidget.h.

Constructor & Destructor Documentation

CQExpressionHighlighter::CQExpressionHighlighter ( CQExpressionWidget ew)

Definition at line 55 of file CQExpressionWidget.cpp.

References mObjectDisplayFormat.

56  : QSyntaxHighlighter(ew),
58 {
59  // COPASI object format
60  mObjectDisplayFormat.setForeground(QColor(100, 0, 200));
61 }
static const char DisplayPattern[]
QTextCharFormat mObjectDisplayFormat
CQExpressionHighlighter::~CQExpressionHighlighter ( )
virtual

Definition at line 63 of file CQExpressionWidget.cpp.

64 {}

Member Function Documentation

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

Definition at line 66 of file CQExpressionWidget.cpp.

References mObjectDisplayFormat, and mObjectDisplayPattern.

67 {
68  int index = mObjectDisplayPattern.indexIn(text);
69 
70  while (index >= 0)
71  {
72  int length = mObjectDisplayPattern.matchedLength();
73  setFormat(index, length, mObjectDisplayFormat);
74  index = mObjectDisplayPattern.indexIn(text, index + length);
75  }
76 }
QTextCharFormat mObjectDisplayFormat

Member Data Documentation

QTextCharFormat CQExpressionHighlighter::mObjectDisplayFormat
QRegExp CQExpressionHighlighter::mObjectDisplayPattern

Definition at line 49 of file CQExpressionWidget.h.

Referenced by highlightBlock().


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