14 : QSyntaxHighlighter(parent)
21 : QSyntaxHighlighter(edit)
29 lightness = palette.color(QPalette::Base).value() < 127 ? 250 : 130;
49 rule.
pattern = QRegExp(QString::fromLatin1(
"\\b[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)\\b"));
55 rule.
pattern = QRegExp(QString::fromLatin1(
"\\$[A-Za-z][A-Za-z0-9]*\\b"));
60 rule.
pattern = QRegExp(QString::fromLatin1(
"#[^\n]*"));
68 QRegExp expression(rule.
pattern);
69 int index = text.indexOf(expression);
71 int length = expression.matchedLength();
73 index = text.indexOf(expression, index +
length);
76 setCurrentBlockState(0);
void fixStyle(const QPalette &palette)
QTextCharFormat numberFormat
ExprHighlighter(QTextDocument *parent)
QTextCharFormat variableFormat
void highlightBlock(const QString &text) override
QVector< HighlightingRule > highlightingRules
QTextCharFormat singleLineCommentFormat
double length(const Vec3d &v)