diff options
Diffstat (limited to 'utils/wpseditor/gui/src')
-rw-r--r-- | utils/wpseditor/gui/src/qsyntaxer.cpp | 25 | ||||
-rw-r--r-- | utils/wpseditor/gui/src/qsyntaxer.h | 2 |
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) : QSyntaxHighlighter(parent) { HighlightingRule rule; - hrules["operator"].pattern = QRegExp("%[^\\| \n<\\?%]{1,2}"); - hrules["operator"].format.setFontWeight(QFont::Bold); - hrules["operator"].format.setForeground(Qt::darkBlue); + hrules[0].pattern = QRegExp("%[^\\| \n<\\?%]{1,2}"); + hrules[0].format.setFontWeight(QFont::Bold); + hrules[0].format.setForeground(Qt::darkBlue); - hrules["question"].pattern = QRegExp("%[\\?]{1}[^<]{1,2}"); - hrules["question"].format.setForeground(Qt::darkMagenta); - - hrules["question2"].pattern = QRegExp("(<|>)"); - hrules["question2"].format.setForeground(Qt::red); + hrules[1].pattern = QRegExp("%[\\?]{1}[^<]{1,2}"); + hrules[1].format.setForeground(Qt::darkMagenta); + hrules[2].pattern = QRegExp("(<|>)"); + hrules[2].format.setForeground(Qt::red); - hrules["limiter"].pattern = QRegExp("\\|"); - hrules["limiter"].format.setForeground(Qt::darkRed); + hrules[3].pattern = QRegExp("\\|"); + hrules[3].format.setForeground(Qt::darkRed); - hrules["comment"].pattern = QRegExp("#[^\n]*"); - hrules["comment"].format.setForeground(Qt::darkGreen); - hrules["comment"].format.setFontItalic(true); + hrules[4].pattern = QRegExp("#[^\n]*"); + hrules[4].format.setForeground(Qt::darkGreen); + hrules[4].format.setFontItalic(true); } // void 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 { QRegExp pattern; QTextCharFormat format; }; - QMap<QString,HighlightingRule> hrules; + QMap<int,HighlightingRule> hrules; public: QSyntaxer(QTextDocument *parent = 0); |