#include <qxrdhighlighter.h>
Definition at line 10 of file qxrdhighlighter.h.
QxrdHighlighter::QxrdHighlighter |
( |
QTextDocument * |
parent = 0 | ) |
|
Definition at line 5 of file qxrdhighlighter.cpp.
References classFormat, commentEndExpression, commentStartExpression, QxrdHighlighter::HighlightingRule::format, functionFormat, highlightingRules, keywordFormat, multiLineCommentFormat, QxrdHighlighter::HighlightingRule::pattern, quotationFormat, and singleLineCommentFormat.
6 : QSyntaxHighlighter(parent)
12 QStringList keywordPatterns;
13 keywordPatterns <<
"\\break\\b" <<
"\\bcase\\b" <<
"\\bcatch\\b"
14 <<
"\\bcontinue\\b" <<
"\\bdefault\\b" <<
"\\bdelete\\b"
15 <<
"\\bdo\\b" <<
"\\belse\\b" <<
"\\bfinally\\b"
16 <<
"\\bfor\\b" <<
"\\bfunction\\b" <<
"\\bif\\b"
17 <<
"\\bin\\b" <<
"\\binstanceof\\b" <<
"\\bnew\\b"
18 <<
"\\breturn\\b" <<
"\\bswitch\\b" <<
"\\bthis\\b"
19 <<
"\\bthrow\\b" <<
"\\btry\\b" <<
"\\btypeof\\b"
20 <<
"\\bvar\\b" <<
"\\btypedef\\b" <<
"\\btypename\\b"
21 <<
"\\bunion\\b" <<
"\\bvoid\\b" <<
"\\bwhile\\b"
23 <<
"\\babstract\\b" <<
"\\benum\\b" <<
"\\bint\\b" <<
"\\bshort\\b"
24 <<
"\\bboolean\\b" <<
"\\bexport\\b" <<
"\\binterface\\b" <<
"\\bstatic\\b"
25 <<
"\\bbyte\\b" <<
"\\bextends\\b" <<
"\\blong\\b" <<
"\\bsuper\\b"
26 <<
"\\bchar\\b" <<
"\\bfinal\\b" <<
"\\bnative\\b" <<
"\\bsynchronized\\b"
27 <<
"\\bclass\\b" <<
"\\bfloat\\b" <<
"\\bpackage\\b" <<
"\\bthrows\\b"
28 <<
"\\bconst\\b" <<
"\\bgoto\\b" <<
"\\bprivate\\b" <<
"\\btransient\\b"
29 <<
"\\bdebugger\\b" <<
"\\bimplements\\b" <<
"\\bprotected\\b" <<
"\\bvolatile\\b"
30 <<
"\\bdouble\\b" <<
"\\bimport\\b" <<
"\\bpublic\\b";
32 foreach (QString pattern, keywordPatterns) {
33 rule.pattern = QRegExp(pattern);
40 rule.pattern = QRegExp(
"\\bQ[A-Za-z]+\\b");
45 rule.pattern = QRegExp(
"//[^\n]*");
52 rule.pattern = QRegExp(
"\".*\"");
58 rule.pattern = QRegExp(
"\\b[A-Za-z0-9_]+(?=\\()");
QRegExp commentStartExpression
QVector< HighlightingRule > highlightingRules
QTextCharFormat singleLineCommentFormat
QTextCharFormat multiLineCommentFormat
QRegExp commentEndExpression
QTextCharFormat keywordFormat
QTextCharFormat classFormat
QTextCharFormat quotationFormat
QTextCharFormat functionFormat
void QxrdHighlighter::highlightBlock |
( |
const QString & |
text | ) |
|
|
protected |
QTextCharFormat QxrdHighlighter::classFormat |
|
private |
QRegExp QxrdHighlighter::commentEndExpression |
|
private |
QRegExp QxrdHighlighter::commentStartExpression |
|
private |
QTextCharFormat QxrdHighlighter::functionFormat |
|
private |
QTextCharFormat QxrdHighlighter::keywordFormat |
|
private |
QTextCharFormat QxrdHighlighter::multiLineCommentFormat |
|
private |
QTextCharFormat QxrdHighlighter::quotationFormat |
|
private |
QTextCharFormat QxrdHighlighter::singleLineCommentFormat |
|
private |
The documentation for this class was generated from the following files: