21 #ifndef _ExprHighlighter_h_
22 #define _ExprHighlighter_h_
23 #include <QtGui/QSyntaxHighlighter>
24 #include <QtGui/QPalette>
43 :QSyntaxHighlighter(parent),
lightness(130)
56 lightness=palette.color(QPalette::Base).value()<127 ? 250: 130;
76 rule.
pattern=QRegExp(
"\\b[0-9]*\\.[0-9]*)?|[0-9]+\\b");
82 rule.
pattern=QRegExp(
"\\$[A-Za-z][A-Za-z0-9]*\\b");
87 rule.
pattern=QRegExp(
"#[^\n]*");
97 int index=text.indexOf(expression);
99 int length=expression.matchedLength();
100 setFormat(index,length,rule.
format);
101 index=text.indexOf(expression,index+length);
104 setCurrentBlockState(0);
QTextCharFormat numberFormat
QTextCharFormat singleLineCommentFormat
QTextCharFormat variableFormat
double length(const Vec3d &v)
For a multi line expression
The result is computed int int< br >< divstyle="margin-left:40px;"> Picks values randomly between loRange and hiRange based on supplied index(which is automatically hashed). 
void highlightBlock(const QString &text)
QVector< HighlightingRule > highlightingRules
void fixStyle(const QPalette &palette)
QTextCharFormat operatorFormat
ExprHighlighter(QTextEdit *edit)
ExprHighlighter(QTextDocument *parent)