QXMLHighlighter.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 // QCodeEditor
4 #include <QStyleSyntaxHighlighter> // Required for inheritance
5 
6 // Qt
7 #include <QVector>
8 #include <QRegularExpression>
9 
15 {
16  Q_OBJECT
17 public:
18 
23  explicit QXMLHighlighter(QTextDocument* document=nullptr);
24 
25 protected:
26 
27  void highlightBlock(const QString& text) override;
28 
29 private:
30 
31  void highlightByRegex(const QTextCharFormat& format,
32  const QRegularExpression& regex,
33  const QString& text);
34 
36  QRegularExpression m_xmlElementRegex;
37  QRegularExpression m_xmlAttributeRegex;
38  QRegularExpression m_xmlValueRegex;
39  QRegularExpression m_xmlCommentBeginRegex;
40  QRegularExpression m_xmlCommentEndRegex;
41 
42 };
43 
QRegularExpression m_xmlValueRegex
QVector< QRegularExpression > m_xmlKeywordRegexes
QRegularExpression m_xmlCommentBeginRegex
QRegularExpression m_xmlAttributeRegex
QRegularExpression m_xmlElementRegex
Class, that describes XML code highlighter.
QRegularExpression m_xmlCommentEndRegex
void highlightByRegex(const QTextCharFormat &format, const QRegularExpression &regex, const QString &text)
QXMLHighlighter(QTextDocument *document=nullptr)
Constructor.
Class, that descrubes highlighter with syntax style.
void highlightBlock(const QString &text) override
std::basic_string< Char > format(const text_style &ts, const S &format_str, const Args &... args)
Definition: color.h:583


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:39