summaryrefslogtreecommitdiff
path: root/utils/wpseditor/gui
diff options
context:
space:
mode:
Diffstat (limited to 'utils/wpseditor/gui')
-rw-r--r--utils/wpseditor/gui/src/qsyntaxer.cpp25
-rw-r--r--utils/wpseditor/gui/src/qsyntaxer.h2
2 files changed, 13 insertions, 14 deletions
diff --git a/utils/wpseditor/gui/src/qsyntaxer.cpp b/utils/wpseditor/gui/src/qsyntaxer.cpp
index fa2608be45..9c4cdd4653 100644
--- a/utils/wpseditor/gui/src/qsyntaxer.cpp
+++ b/utils/wpseditor/gui/src/qsyntaxer.cpp
@@ -6,24 +6,23 @@ QSyntaxer::QSyntaxer(QTextDocument *parent)
6 : QSyntaxHighlighter(parent) { 6 : QSyntaxHighlighter(parent) {
7 HighlightingRule rule; 7 HighlightingRule rule;
8 8
9 hrules["operator"].pattern = QRegExp("%[^\\| \n<\\?%]{1,2}"); 9 hrules[0].pattern = QRegExp("%[^\\| \n<\\?%]{1,2}");
10 hrules["operator"].format.setFontWeight(QFont::Bold); 10 hrules[0].format.setFontWeight(QFont::Bold);
11 hrules["operator"].format.setForeground(Qt::darkBlue); 11 hrules[0].format.setForeground(Qt::darkBlue);
12 12
13 13
14 hrules["question"].pattern = QRegExp("%[\\?]{1}[^<]{1,2}"); 14 hrules[1].pattern = QRegExp("%[\\?]{1}[^<]{1,2}");
15 hrules["question"].format.setForeground(Qt::darkMagenta); 15 hrules[1].format.setForeground(Qt::darkMagenta);
16
17 hrules["question2"].pattern = QRegExp("(<|>)");
18 hrules["question2"].format.setForeground(Qt::red);
19 16
17 hrules[2].pattern = QRegExp("(<|>)");
18 hrules[2].format.setForeground(Qt::red);
20 19
21 hrules["limiter"].pattern = QRegExp("\\|"); 20 hrules[3].pattern = QRegExp("\\|");
22 hrules["limiter"].format.setForeground(Qt::darkRed); 21 hrules[3].format.setForeground(Qt::darkRed);
23 22
24 hrules["comment"].pattern = QRegExp("#[^\n]*"); 23 hrules[4].pattern = QRegExp("#[^\n]*");
25 hrules["comment"].format.setForeground(Qt::darkGreen); 24 hrules[4].format.setForeground(Qt::darkGreen);
26 hrules["comment"].format.setFontItalic(true); 25 hrules[4].format.setFontItalic(true);
27} 26}
28// 27//
29void QSyntaxer::highlightBlock(const QString &text) { 28void QSyntaxer::highlightBlock(const QString &text) {
diff --git a/utils/wpseditor/gui/src/qsyntaxer.h b/utils/wpseditor/gui/src/qsyntaxer.h
index b85651cf69..893eac61a6 100644
--- a/utils/wpseditor/gui/src/qsyntaxer.h
+++ b/utils/wpseditor/gui/src/qsyntaxer.h
@@ -11,7 +11,7 @@ class QSyntaxer : public QSyntaxHighlighter {
11 QRegExp pattern; 11 QRegExp pattern;
12 QTextCharFormat format; 12 QTextCharFormat format;
13 }; 13 };
14 QMap<QString,HighlightingRule> hrules; 14 QMap<int,HighlightingRule> hrules;
15public: 15public:
16 QSyntaxer(QTextDocument *parent = 0); 16 QSyntaxer(QTextDocument *parent = 0);
17 17