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 
QVector< QRegularExpression >
QXMLHighlighter::m_xmlAttributeRegex
QRegularExpression m_xmlAttributeRegex
Definition: QXMLHighlighter.hpp:37
QXMLHighlighter::highlightBlock
void highlightBlock(const QString &text) override
QXMLHighlighter::highlightByRegex
void highlightByRegex(const QTextCharFormat &format, const QRegularExpression &regex, const QString &text)
QXMLHighlighter
Class, that describes XML code highlighter.
Definition: QXMLHighlighter.hpp:14
format
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
Definition: color.h:543
QXMLHighlighter::m_xmlKeywordRegexes
QVector< QRegularExpression > m_xmlKeywordRegexes
Definition: QXMLHighlighter.hpp:35
QXMLHighlighter::QXMLHighlighter
QXMLHighlighter(QTextDocument *document=nullptr)
Constructor.
QStyleSyntaxHighlighter
Class, that descrubes highlighter with syntax style.
Definition: QStyleSyntaxHighlighter.hpp:12
QXMLHighlighter::m_xmlCommentBeginRegex
QRegularExpression m_xmlCommentBeginRegex
Definition: QXMLHighlighter.hpp:39
QXMLHighlighter::m_xmlCommentEndRegex
QRegularExpression m_xmlCommentEndRegex
Definition: QXMLHighlighter.hpp:40
QXMLHighlighter::m_xmlValueRegex
QRegularExpression m_xmlValueRegex
Definition: QXMLHighlighter.hpp:38
QXMLHighlighter::m_xmlElementRegex
QRegularExpression m_xmlElementRegex
Definition: QXMLHighlighter.hpp:36


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:25