diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2017-01-19 11:36:59 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-12 22:09:43 +0000 |
commit | 98e0cb0a28845fd6b808c25d2e049f8da1f9867c (patch) | |
tree | 18065ef2ecba6a9fc8c881f44e7b666ae1b01127 /examples/widgets/richtext/syntaxhighlighter/highlighter.h | |
parent | feaaca456b1b9f5f6ba84f0aa3cb7e93dfb862cf (diff) |
Doc: updated QSyntaxHighlighter documentation and use QRegularExpression
The documentation of QSyntaxHighlighter still uses the deprecated
QRegExp class. This patch updates the code samples as well as cleanup
some typos.
Change-Id: I87b525fddb560b7c5bb38f96d9aaceadb594f76c
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Diffstat (limited to 'examples/widgets/richtext/syntaxhighlighter/highlighter.h')
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter/highlighter.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/widgets/richtext/syntaxhighlighter/highlighter.h b/examples/widgets/richtext/syntaxhighlighter/highlighter.h index 39141615fc..0a24224b56 100644 --- a/examples/widgets/richtext/syntaxhighlighter/highlighter.h +++ b/examples/widgets/richtext/syntaxhighlighter/highlighter.h @@ -53,6 +53,7 @@ #include <QSyntaxHighlighter> #include <QTextCharFormat> +#include <QRegularExpression> QT_BEGIN_NAMESPACE class QTextDocument; @@ -72,13 +73,13 @@ protected: private: struct HighlightingRule { - QRegExp pattern; + QRegularExpression pattern; QTextCharFormat format; }; QVector<HighlightingRule> highlightingRules; - QRegExp commentStartExpression; - QRegExp commentEndExpression; + QRegularExpression commentStartExpression; + QRegularExpression commentEndExpression; QTextCharFormat keywordFormat; QTextCharFormat classFormat; |